Python bindings for MetroHash
Project description
metrohash-python
Python bindings for the fast non-cryptograpical hash function MetroHash. MetroHash C++ library by J. Andrew Rogers, Python bindings by Dobatymo.
Requirements
The library has been tested on Linux Python 2.7 and 3.6, and on Windows Python 3.5, 3.6, 3.7.
Install
pip install metrohash-python
Compilation requires a C++ compiler and optionally Cython
.
Examples
The usage is similar to Python's hashlib.
>>> import metrohash
>>> h = metrohash.MetroHash128()
>>> h.update(b'asd')
>>> h.update(b'qwe')
>>> h.digest()
b'K\xfb\x17\xeb>\xb2W\xbd\x93\xad\xf6\x17\xceg\x14\xda'
>>> h.hexdigest()
'4bfb17eb3eb257bd93adf617ce6714da'
Or as simple non-incremental function:
>>> import metrohash
>>> metrohash.metrohash128(b'asdqwe')
b'K\xfb\x17\xeb>\xb2W\xbd\x93\xad\xf6\x17\xceg\x14\xda'
The interface for MetroHash64
and metrohash64
is the same.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for metrohash-python-1.1.3.post2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f9d0d7f52b0ad34ceb9b64f61d5c9882713ac2dc85511d7f6a4f02d9b5f27d6 |
|
MD5 | 31e3911715c21777850166238fd10d4c |
|
BLAKE2b-256 | 3caa1bd3fe894130bf07855a5b0b7f23cc74068acc7a2857f164c3a9df8a9949 |
Close
Hashes for metrohash_python-1.1.3.post2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7f45fae17020f9876e90710cbb0aeaa0a5eff5e3e48417ca2439672c5c084e8 |
|
MD5 | efb5aea558f87e09039eb704fdd28065 |
|
BLAKE2b-256 | 95c4b95a07de741d1335a804d6b1e971036bf8ad040fae039d616e81fecebd47 |
Close
Hashes for metrohash_python-1.1.3.post2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e5e0f5bb6fa3601bd1a021423cc3c2b2d3cba2364408d74a2b0a4752f2a7db6 |
|
MD5 | b449442cb894958e0b150a175d28c750 |
|
BLAKE2b-256 | 4147e4cb7b9cb49bb77e68c9a4cf672ae91b59aba3063bbb51a4f026319c3d84 |
Close
Hashes for metrohash_python-1.1.3.post2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf45e43b3a17f5fb012cf8d57f6de4ac56b2dcdf8737b91b337f9c330ca61521 |
|
MD5 | 9f2b14a99e8c3ee02e9be954f7199a0b |
|
BLAKE2b-256 | 17319b9ea06a868dd72cf27f1575902d32efeebf4adc40e6c11deb742f4ba75b |
Close
Hashes for metrohash_python-1.1.3.post2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bed29ee69a7e08c6d9bf5f063448b3271a924b30ac88faf6981cabbb9599816 |
|
MD5 | affbf9730de4a93b9484fa0b7819b53d |
|
BLAKE2b-256 | 8e735e4945ab1a2f1fcc7307333e8b62b7bee98a1cdac70de9a6cbe9192e5e46 |
Close
Hashes for metrohash_python-1.1.3.post2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd24a20deeb6dfbe8ef644184cb3bb33a11a84f284582d73800476b9641b03ca |
|
MD5 | 66c9f35405df0ba471b7f5c0fe4ba864 |
|
BLAKE2b-256 | c906da174c9c6477b26c7348ce568b14df0356be30d3e406a61280215de4708d |