i want to XOR a byte with another byte in a document and then doing XOR of the result obtained with next byte of a document,similarly XORing the whole document.please explain with an example
i want to XOR a byte with another byte in a document and then doing XOR of the result obtained with next byte of a document,similarly XORing the whole document.please explain with an example
Where are you stuck?
Reading bytes? Using XOR?
Please reply with the code you have so far.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
It's pretty basic. That should do what you need.Code:xorValue = initialValue; while not done toXor = nextValue( fromSomeplace ); toXor ^= xorValue; doSomethingWith( toXor ); xorValue = toXor;
Quzah.
Hope is the first step on the road to disappointment.
XOR means exclusive OR, where if both of the bits being tested are different, the result is 1, 0 if they're the same :-)
*Cela*
Here is a good text on the subject.Originally posted by Munkey01
What acually does XOR do?
Quzah.
Hope is the first step on the road to disappointment.
When we use the word OR in our daily lives, we usually mean exclusive or (XOR). If you say "I'm gonna rent a movie or go to the cinema" you mean "rent a movie" OR "go to the cinema", not both, which is exactly what XOR is. One or the other, not both.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.