murmurhash

Fast hash function library with Python bindings via Cython.

pipmacoslinuxwindows
Try with needOr install directly
Source

About

Cython bindings for MurmurHash

Examples

hash a string quickly in Python$ python3 -c "from murmurhash.mrmr import hash32; print(hash32('hello'))"
generate consistent hash values for data$ python3 -c "from murmurhash.mrmr import hash64; print(hash64(b'test_data'))"
use murmurhash in a Python script for fast hashing$ python3 << 'EOF' from murmurhash.mrmr import hash32 for word in ['apple', 'banana', 'cherry']: print(f'{word}: {hash32(word)}') EOF
compare hash output across multiple strings$ python3 -c "from murmurhash.mrmr import hash32; items = ['cat', 'dog', 'bird']; [print(f'{i}: {hash32(i)}') for i in items]"
integrate fast hashing into machine learning pipelines$ python3 << 'EOF' from murmurhash.mrmr import hash32 features = ['feature_a', 'feature_b', 'feature_c'] hashes = [hash32(f) for f in features] print(f'Feature hashes: {hashes}') EOF