cityhash-0.0.1: bindings to Google CityHash

Portabilityportable (FFI)




This module implements a binding to Google's CityHash family of hashing functions. You can find more information here: It implements both the 64-bit and 128-bit interfaces.

Note that CityHash is designed to work on architectures where unaligned reads have a small penalty. In practice it is only used at Google on little-endian Intel/AMD CPUs it seems, and has not been tested on big-endian architectures.


Hashing values

cityHash64 :: ByteString -> Word64Source

Hash a value into a 64bit result.

cityHash128 :: ByteString -> Word128Source

Hash a value into a 128bit result. Per the google documentation, this is probably faster for inputs which the length is greater than, say, 200 bytes. It's also used inside google for code that wants to have minimal collisions.