Generated by GPT-5-mini| FNV | |
|---|---|
| Name | FNV |
| Developer | Google (company), Bob Jenkins |
| Released | 1991 |
| Latest release version | varied |
| Programming language | C (programming language), Python (programming language), Java (programming language) |
| Operating system | Linux, Windows, macOS |
| License | Public domain |
FNV
FNV is a family of non-cryptographic hash functions designed for fast hashing of byte sequences and strings for use in data structures, indexing, and checksums. Originating in the early 1990s, FNV balances simplicity, speed, and diffusion using multiplication and XOR operations, and has been implemented across multiple languages and platforms including C (programming language), Java (programming language), Python (programming language), Go (programming language), and Rust (programming language). The algorithm influenced many hashing utilities and has been compared and contrasted with functions such as MurmurHash, CityHash, xxHash, SipHash, and SHA-1 in practical deployments.
FNV was created to provide a small, portable, and efficient hashing primitive suitable for hashtables, checksums, and fingerprinting in software like SQLite, Linux kernel, Redis, Apache HTTP Server, and embedded systems. The canonical FNV variants are commonly known in community sources and implementations for 32-bit and 64-bit outputs, and extended forms such as FNV-1 and FNV-1a. FNV’s operations are grounded in fixed-width integer arithmetic found in processors produced by companies such as Intel, ARM Holdings, AMD, and MIPS Technologies.
FNV traces to work by practitioners addressing hashing needs in projects connected to institutions like NASA, academic labs, and open-source ecosystems that include The Free Software Foundation and The Apache Software Foundation. Early dissemination occurred via informal repositories and lists maintained by authors including Bob Jenkins and contributors active in Usenet and later on platforms like SourceForge and GitHub. Over time researchers and engineers compared FNV to contemporaries such as DJB (Daniel J. Bernstein), Paul Hsieh, and algorithms published in venues that reference ACM proceedings and technical reports from University of Cambridge and Massachusetts Institute of Technology. Debates on endianness, avalanche behavior, and distribution properties led to multiple community-driven tweaks and formalizations.
FNV’s core design uses an initial offset basis and repeated application of a multiply (by a prime) and an XOR with input octets; two principal variants exist: FNV-1 (multiply then XOR) and FNV-1a (XOR then multiply). Standardized offset bases and primes correspond to output widths associated with integer sizes used in environments like x86-64 and ARM64; popular sizes include 32-bit, 64-bit, 128-bit, 256-bit, and 512-bit versions referenced in implementation notes for OpenSSL, BIND, and networking stacks. Variants include byte-wise, word-wise, and folding versions used in projects from Mozilla to Oracle Corporation, and extended mixtures combined with mixing steps inspired by MurmurHash3 and rotations used in CityHash-style approaches.
Performance characteristics of FNV emphasize low instruction count and good throughput on general-purpose processors such as those in Intel Core and ARM Cortex families, resulting in favorable benchmarks against older functions like CRC32 in table-driven contexts and competitive comparisons with MurmurHash and xxHash for short inputs. Security properties are intentionally limited: FNV is non-cryptographic and not designed to resist adversarial collision or preimage attacks that cryptographic hashes like SHA-256 or BLAKE2 provide. In deployments exposed to untrusted inputs, researchers referenced by institutions like CERT and NIST recommend cryptographic alternatives such as SipHash for hash-table DoS mitigation and HMAC or SHA-3 for authenticated integrity.
Implementations of FNV appear in standard libraries and projects including glibc, LLVM, Boost (C++ libraries), and language runtimes like CPython and OpenJDK. Applications leverage FNV for symbol tables in compilers such as GCC and Clang, for content-addressing in systems like Git-adjacent tooling, and for quick checksums in databases such as PostgreSQL and MySQL. Networking stacks in FreeBSD, caching systems like Varnish (software), and file-indexing tools within GNOME and KDE also include FNV-based options. Ports and bindings exist for ecosystems including Node.js, Ruby (programming language), Perl, PHP, and package managers like npm and CPAN.
Notable uses of FNV include hash table keys in Redis modules, symbol hashing in SQLite query planning, header hashing in NGINX modules, and identifiers in container tooling from Docker-related projects. Source-control utilities and diff tools referencing FNV appear alongside tools developed at Google (company) and Facebook where fast, low-overhead hashing was required for indexing and shard selection in distributed systems like Bigtable-derived engines. Open-source projects such as GitHub repositories, academic datasets hosted by UC Berkeley, and tools in Debian and Fedora Project packaging demonstrate widespread practical examples.
FNV is criticized for limited avalanche and diffusion properties compared with modern non-cryptographic hashes like xxHash and MurmurHash3, and for vulnerability to collision attacks in adversarial contexts highlighted by security teams at organizations like OWASP. Its simple multiplicative structure yields biases for certain patterned inputs, prompting caution in high-collision-risk scenarios encountered by content distribution networks like Akamai Technologies and by web platforms such as Cloudflare. Consequently, maintainers of projects like SQLite and Linux kernel have evaluated alternatives or added mitigations (e.g., randomized seeds) inspired by research from Stanford University and ETH Zurich.
Category:Hash functions