XORing
XORing is the operation of applying the exclusive OR (XOR) to two binary inputs. The XOR result is 1 when exactly one of the inputs is 1, and 0 otherwise. In boolean algebra this is represented as a ⊕ b, and the operation is commutative and associative.
Truth table: for bits a and b, a ⊕ b equals 0 if a=b, and 1 if a≠b.
Beyond single bits, XOR is applied bitwise to binary strings and vectors. It is addition modulo 2,
Applications: In cryptography, if a random key stream is XORed with plaintext (a one-time pad, if the
In programming, XOR is often used for bitwise manipulation, including the common two-variable swap technique that