FNV-1
The Fowler–Noll–Vo hash: a minimal multiply-and-XOR function for hash tables
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About FNV-1
FNV-1 is one of 2 FNV hash variants in the NextSSL registry, a checksum / non-cryptographic hash. It produces an 8-byte (64-bit) output. Its registry entry cites FNV-1 64-bit (Fowler, Noll, Vo; draft-eastlake-fnv), NON-cryptographic. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
FNV is a non-cryptographic hash function created by Glenn Fowler, Landon Curt Noll and Kiem-Phong Vo. Its simplicity, a single multiply and XOR per byte, made it popular in compilers, DNS servers and hash tables. It provides no security against a deliberate attacker.
FNV starts from a fixed offset basis and, for each input byte, either multiplies the hash by a large FNV prime and then XORs the byte (FNV-1) or XORs first and then multiplies (FNV-1a). FNV-1a has slightly better avalanche behaviour. Primes and offset bases are defined for widths from 32 to 1024 bits.
NextSSL includes the 64-bit FNV-1 and FNV-1a, as described in draft-eastlake-fnv, wired from source and not yet verified. Its simplicity makes it easy to embed and reimplement. None of this provides security: the function has no secret key, and anyone can compute or deliberately collide its outputs. Use SipHash instead.
History
1991–1991FNV hash published by Glenn Fowler, Landon Curt Noll, Kiem-Phong Vo
Security notes
FNV is not cryptographic. Collisions are easy to construct and it has no key or seed, so it is vulnerable to hash flooding when inputs are adversarial.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 8 | Output |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
value = root.call("checksum", "fnv-1", None, b"123456789")[0]
nextssl_root_checksum("fnv-1", NULL, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_checksum_in(reg::all(), Policy::Any, "fnv-1", &Params::new())?;
let value = alg.checksum(b"123456789")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other FNV hash variants
1More checksums and non-cryptographic hashes
All 130Frequently asked questions
What is FNV-1?
FNV-1 is a checksum in the FNV hash family. FNV is a non-cryptographic hash function created by Glenn Fowler, Landon Curt Noll and Kiem-Phong Vo.
What are the FNV-1 sizes?
In NextSSL, FNV-1 uses: output 8 bytes.
Who designed FNV-1 and when?
FNV-1 belongs to the FNV hash family, first published in 1991 by Glenn Fowler, Landon Curt Noll, Kiem-Phong Vo. Its origin: draft-eastlake-fnv.
Which standards define FNV-1?
FNV-1 is referenced by FNV-1 64-bit (Fowler, Noll, Vo; draft-eastlake-fnv), NON-cryptographic.
Is FNV-1 safe to use?
FNV-1 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other FNV hash variants are there?
NextSSL also registers fnv-1a in the FNV hash family.