Uses of Exclusive OR
- Hashing: hash functions are closely related to encryption.
- Graphics: background ⊕ picture paints picture, but another
⊕ picture erases it and restores background. This is especially
good for animation and for cursors, which move across a background.
- Linked lists: both forward and backward pointers can be stored in
the same space using next ⊕ previous. Since we will be coming
from either next or previous, we can ⊕ with the link value
to get the other one.
- RAID[redundant array of independent disks]:
a disk that stores (a ⊕ b) can back up two
other disks, a and b. If a fails, b ⊕ (a ⊕ b) = a;
if b fails, a ⊕ (a ⊕ b) = b.
- Wireless networking: if message (a ⊕ b) is broadcast,
those who know a can get b, and those who know b can get a.