Created
May 20, 2013 03:09
-
-
Save jfpoole/5610222 to your computer and use it in GitHub Desktop.
byteswap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t byteswap(uint32_t value) | |
{ | |
return ((value >> 24) & 0x000000ff) | | |
((value >> 8) & 0x0000ff00) | | |
((value << 8) & 0x00ff0000) | | |
((value << 24) & 0xff000000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment