Stephan van Hulst wrote:I think it's a nice parlor trick.
It's not just a parlour trick; it actually has many applications - such as fault-tolerance (specifically RAID5), cryptography, and graphics (it was one of the early ways of creating a mouse pointer or "floating cursor" - don't know if it's still used for that now or not).
It was also the method old computers used to use to 'zero' memory (because
x ^ x == 0). Again, I don't know if it's still used for that now or not.
The reason for its use in cryptography is that there is no "un-XOR" function - that is: given
x ^ y, there is no way to determine
x or
y without guessing if you don't know either of them (and hence the need for passwords to be secret).
It's also
blisteringly fast - usually operating in a single machine cycle.
I can't believe I didn't spot it myself (until Stephan's post a while back) because it was one of the first things I thought of; but I didn't follow it through logically. Just stupid I guess.
Winston