Created
May 3, 2023 16:21
-
-
Save drchaos/a820125861f682c8991eaebe18d8cf04 to your computer and use it in GitHub Desktop.
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
hashBS :: ByteString -> Word32 | |
hashBS = B.foldl fnv1aHash32Base fnvOffsetBasis32 | |
hashBS_unpack :: ByteString -> Word32 | |
hashBS_unpack = foldl' fnv1aHash32Base fnvOffsetBasis32 . B.unpack | |
hashBS_С :: ByteString -> Word32 | |
hashBS_С bs = B.unsafeDupablePerformIO $! | |
B.unsafeUseAsCStringLen bs (\ (ptr, l) -> fnv1a_32 (castPtr ptr) l) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment