Python 3.7+ FNV (fnv0, fnv1, fnv1a) non-cryptographic hash library implemented in C through libffi
Project description
fnv-c
What is it?
fnv-c is a Python 3.7+ FNV (fnv0
, fnv1
, fnv1a
) non-cryptographic hash library implemented in C through libffi.
Features
- speed: 4 000% faster than basic Python implementation, 40% faster than
pyhash
- portability:
- tested with recent Python versions (3.7+)
- compatible with ARM64 and avoid too agressive CPU optimizations
- compatible with PyPy
- two variants: 32bits (
fnv0_32()
) and 64bits (fnv0_64()
)
Non features
- other hash algorithms (this library is about a specific algorithm)
How to install/use it?
pip install git+https://github.com/botify-labs/fnv-c.git#egg=fnv_c
import fnv_c
print(fnv_c.fnv0_32(b"foo bar"))
print(fnv_c.fnv0_64(b"foo bar"))
Function signatures / API
Full API doc is available at: https://botify-labs.github.io/fnv-c/fnv_c/
Dev
pip install -r dev-requirements.txt
python setup.py develop
# get all tasks (lint, test, clean...)
invoke --list
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fnv-c-0.1.4.tar.gz
(2.9 kB
view details)
File details
Details for the file fnv-c-0.1.4.tar.gz
.
File metadata
- Download URL: fnv-c-0.1.4.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12d35af41f4d124f425755f8d573a9f258f87858471c8ed7f20e1d655a6c0e74 |
|
MD5 | 4f0594b5240e516493e65db2f0b715ad |
|
BLAKE2b-256 | bb2486cfa6e89313c1c85ba8203981c6ec39d993ac1b789c276c379745d44786 |