skip to navigation
skip to content

mmh3 2.0

Python library for MurmurHash3, a set of fast and robust hash functions.

Downloads ↓

Python library for MurmurHash3, a set of fast and robust hash functions.

mmh3 2.0 now supports both Python 2.7 and 3.x. The interface is greatly changed.

Sample usage:
>>> import mmh3
>>> mmh3.hash('foo') # 32 bit signed int
-292180858
>>> mmh3.hash64('foo') # two 64 bit signed ints
(-2129773440516405919, 9128664383759220103)
>>> mmh3.hash_bytes('foo') # 128 bit value as bytes
'aE\xf5\x01W\x86q\xe2\x87}\xba+\xe4\x87\xaf~'
>>> mmh3.hash('foo', 42) # uses 42 for a seed
725194882
hash64 and hash_bytes have a third argument for architecture optimization. Use True for x64 and False for x86 (default: True).
>>> mmh3.hash64('foo', 42, True)
(-840311307571801102, -6739155424061121879)

MurmurHash3 was created by Austin Appleby, http://code.google.com/p/smhasher/

Modified by Hajime Senuma

 
File Type Py Version Uploaded on Size # downloads
mmh3-2.0.tar.gz (md5) Source 2011-06-07 4KB 822