I have the following line of code:
contents[pos++] ^= key[shift++];
What does operator ^=
mean?
It is the XOR assignment operator. Basically:
x ^= y;
is the same as:
x = x ^ y;
This means preform an XOR operation on contents[pos++]
using key[shift++]
and set contents[pos++]
equal to the result.
Example:
contents[pos++] 00010101
key[shift++] 10010001
--------
10000100
It is a bitwise XOR operator.
x ^= y
is basically
x = x ^ y
of course, this is a bitwise operation
http://en.wikipedia.org/wiki/Bitwise_operation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With