FNV Hash Fast

2.0.2 · active · verified Thu Apr 16

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.

Common errors

Warnings

Install

Imports

Quickstart

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}")

view raw JSON →