cityhash-0.0.3: Bindings to CityHash

Portabilityportable (FFI)
Stabilityexperimental
Maintaineras@hacks.yi.org

Data.Digest.CityHash

Contents

Description

This module implements a binding to the CityHash family of hashing functions. You can find more information here: http://code.google.com/p/cityhash/. It implements both the 64-bit and 128-bit interfaces.

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

Synopsis

Hashing values

cityHash64 :: ByteString -> Word64Source

Hash a value into a 64bit result.

cityHash128 :: ByteString -> Word128Source

Hash a value into a 128bit result. Per the documentation, this is probably only faster for inputs with a length greater than approximately 200 bytes. Alternatively, use this when you wish to have minimal collisions.