Created
February 5, 2019 18:42
-
-
Save chessai/371956da017999d2716b0e8af266d3c8 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
reverseBits :: Word8 -> Word8 | |
reverseBits b' = | |
let b = fromIntegral b' :: Word32 | |
!x = ((((b * 0x0802 .&. 0x22110) .|. ((b * 0x8020) .&. 0x88440)) * 0x10101) `unsafeShiftR` 16 | |
in fromIntegral x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment