Skip to content

Instantly share code, notes, and snippets.

@jfpoole
Created May 20, 2013 03:09
Show Gist options
  • Save jfpoole/5610222 to your computer and use it in GitHub Desktop.
Save jfpoole/5610222 to your computer and use it in GitHub Desktop.
byteswap
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