Thread: XOR Help ?

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    21

    XOR Help ?

    Could someone give me a rough outline of whats going on with XOR, i understand truth tables, from what i can make out that has something to do with it, is it just a case of substituting bytes according to a key ?

    I probably sound insanely misinformed, apologied.

    If someone could direct me to a site or explain it to me, id be extremely grateful.

    Thx in advance.

  2. #2
    Registered User dharh's Avatar
    Join Date
    Jan 2002
    Posts
    51
    XOR simply means only one of the two evaluating sides can be true at one time for the expression to be true. e.g. in the truth tables.

    1 XOR 1 IS 0
    0 XOR 1 IS 1
    1 XOR 0 IS 1
    0 XOR 0 IS 0

  3. #3
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    XOR simply means a or b but not both.

    It is quite useful in encryption, because it is bitwise reversible from a key, unlike OR and AND.

  4. #4
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    Xor is very useful...

    Like the instant set to 0:

    variable ^= variable;

    or swapping two variables without a temp variable

    a ^= b;
    b ^= a;
    a ^= b;

Popular pages Recent additions subscribe to a feed