Created
July 19, 2017 21:00
-
-
Save pftbest/eda06c809883b73695b2602f00123538 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| static const uint8_t reverse_lookup[16] = { | |
| 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, | |
| 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf, | |
| }; | |
| uint8_t reverse_bits(uint8_t n) | |
| { | |
| return (reverse_lookup[n & 0xf] << 4) | reverse_lookup[n >> 4]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment