# Quick check - using XOR on hex values (SOLVED)

This topic is 4700 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all, I haven't had to deal with hexadecimals in programming so far, but I've just been reading up on them, and would I be right in thinking the following: 0x45 XOR 0xA5 = 0xE0 ? Hope so, as it seems pretty straightforward, but just wanna check. ;) Thanks, James

##### Share on other sites
The standard windows calculator has an XOR button (and can deal with binary, hex or octal as well as decimal), for your future checking needs. Just switch it to Scientific mode (in the View menu).

And yes: 0x45 XOR 0xA5 = 0xE0 is correct.

John B

##### Share on other sites
Quote:
 Original post by JohnBSmallThe standard windows calculator has an XOR button (and can deal with binary, hex or octal as well as decimal), for your future checking needs. Just switch it to Scientific mode (in the View menu).John B

Ah, didn't know that (obviously)! Many thanks John. :)

James

##### Share on other sites
It's easier to see if you convert it to binary numbers.
0x45: 01000101      xor0xA5: 10100101      =      11100000 (0xE0)
But nothing beats a calculator. [smile]

##### Share on other sites
Quote:
 Original post by WanMasterIt's easier to see if you convert it to binary numbers.0x45: 01000101 xor0xA5: 10100101 = 11100000 (0xE0)But nothing beats a calculator. [smile]

Yeah, that's the way I worked it out myself. But once you know how it's done, as you say, nothing beats a calculator. ;)

James

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633340
• Total Posts
3011421
• ### Who's Online (See full list)

There are no registered users currently online

×