Registry / serialization / fnv-hash-fast

fnv-hash-fast

JSON →
library2.0.3pypypi✓ verified 86d ago

FNV Hash Fast is a high-performance Python library providing FNV-1a hash functions (32-bit and 64-bit). It leverages C extensions for maximum speed, offering a significantly faster alternative to pure Python implementations. The current version is 2.0.2, with recent releases focusing on performance improvements and platform support.

pip install fnv-hash-fast
INSTALL
IMPORT
SIG · FNV-HASH-FAST
F
fnv-hash-fast
serializationpythonv2.0.3
Install
3.1s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.1s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fnv1a_32
from fnvhash import fnv1a_32
fnv1a_64
from fnvhash import fnv1a_64

This example demonstrates how to compute 32-bit and 64-bit FNV-1a hashes for a given byte string. Note that the input must be a bytes-like object.

from fnvhash import fnv1a_32, fnv1a_64 data_bytes = b"hello world" hash_32_bit = fnv1a_32(data_bytes) hash_64_bit = fnv1a_64(data_bytes) print(f"FNV-1a 32-bit hash of '{data_bytes.decode()}': {hash_32_bit}") print(f"FNV-1a 64-bit hash of '{data_bytes.decode()}': {hash_64_bit}")
Debug
Known issues
breakingVersion 2.0.0 introduced significant internal changes, replacing the Cython wrapper with a direct METH_O C extension for performance. While the primary Python API (`fnv1a_32`, `fnv1a_64`) appears stable for most users, this major version bump could indicate subtle behavioral changes or affect environments with specific build toolchains.
fix
Review your code for any reliance on internal implementation details or specific build behaviors. Test thoroughly after upgrading.
affects: >=2.0.0
gotchaThe library explicitly requires Python 3.10 or newer. Installing on older Python versions will result in an error or an older, incompatible version being installed.
fix
Ensure your Python environment is 3.10 or later. Use `python --version` to check.
affects: <2.0.0 for older Python, >=2.0.0 requires >=3.10
gotchaFNV hash functions, like most cryptographic and hashing functions, expect a `bytes-like object` as input, not a standard Python string (`str`). Passing a string will raise a `TypeError`.
fix
Convert strings to bytes using `.encode()` before passing them to `fnv1a_32` or `fnv1a_64`, e.g., `my_string.encode('utf-8')`.
affects: all
Errors
Common errors & fixes
TypeError: a bytes-like object is required, not 'str'
Attempting to hash a Python string (`str`) instead of a bytes-like object.
fix
Ensure the input to `fnv1a_32()` or `fnv1a_64()` is a `bytes` object. Convert strings using `.encode('utf-8')` (or another appropriate encoding).
ModuleNotFoundError: No module named 'fnvhash'
The `fnv-hash-fast` package is not installed in the current Python environment, or the import statement is incorrect.
fix
Install the package using `pip install fnv-hash-fast`. Verify your Python environment is active and the import is `from fnvhash import ...`.
Upgrade
Version history
2.0.3latest on PyPI · released May 16, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
fnv-hash-fast — pip install fnv-hash-fast · libregistry