fnvhash is a pure Python implementation of the FNV (Fowler-Noll-Vo) hash function family, including FNV-1 and FNV-1a variants. It is known for its simplicity and speed in non-cryptographic hashing applications. The library is actively maintained, with its current version 0.2.1, and focuses on correctness with 100% test coverage.
pip install fnvhashVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use the 32-bit FNV-1a and 64-bit FNV-1 hash functions. It highlights the requirement for input data to be `bytes` objects.
Do not use FNV hash functions for security-sensitive applications. Use `hashlib.sha256` or similar.
Ensure all input data is encoded to `bytes` (e.g., `my_string.encode('utf-8')`) before passing it to the hash function.For maximum performance, consider using alternative libraries that provide C implementations of FNV hashing, such as `fnvhash-c` or `fnv-hash-fast` (which can fall back to pure Python `fnvhash`).
Ensure your environment uses Python 3.9 or a newer compatible version.
pip install fnvhash
Encode the string to bytes before passing it to the hash function, for example: `data.encode('utf-8')`.Import specific hash functions directly from the fnvhash module, such as: `from fnvhash import fnv1a_32, fnv1_64`.
No dependency data recorded yet.