Jump to content
  • Advertisement
Sign in to follow this  
uncle albert

Quick check - using XOR on hex values (SOLVED)

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Quote:
Original post by JohnBSmall
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).

John B


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

James

Share this post


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

Share this post


Link to post
Share on other sites
Quote:
Original post by WanMaster
It's easier to see if you convert it to binary numbers.
0x45: 01000101
xor
0xA5: 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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!