Popularity
6.6
Growing
Activity
3.0
-
8
4
8

Monthly Downloads: 132
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Data     Digest    
Latest version: v0.1

murmur-hash alternatives and similar packages

Based on the "Data" category.
Alternatively, view murmur-hash alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of murmur-hash or a related project?

Add another 'Data' Package

README

murmur-hash

A simple, Haskell-only implementation of MurmurHash2.

Two variants are provided: 32 bit and 64 bits. We do not simply use the machine word size since the bit width of the hash determines the collision probability which should stay under user control.

Example Usage

Generating hashes:

$ import Data.Digest.Murmur32
$ hash32 "foo"             ==> Hash32 0xd2d0a99a
$ hash32 "foa"             ==> Hash32 0x7d544e71
$ hash32WithSeed 42 "foo"  ==> Hash32 0x7a69563b

Custom instances:

data Foo a = Foo a | Bar String

instance Hashable32 a => Hashable32 (Foo a) where
  hash32Add (Bar s) = hash32AddInt 1 `combine` hash32Add s
  hash32Add (Foo a) = hash32AddInt 2 `combine` hash32Add a