xxHash
Yann Collet's extremely fast non-cryptographic hash family: XXH32, XXH64, XXH3 and XXH128
Overview
xxHash is a family of non-cryptographic hash functions by Yann Collet, designed to run at memory-bandwidth speed. It is used in compression formats such as Zstandard and LZ4, databases and build systems for checksums and hash tables. It provides no security against a deliberate attacker.
XXH32 and XXH64 process input in stripes using four parallel accumulators updated with multiplication by large primes, rotation and addition, then merge and avalanche the accumulators. XXH3, introduced in 2019, uses a different design built for SIMD: it multiplies 32-bit halves of input XORed with a secret table to 64-bit products and accumulates them, with special fast paths for short inputs. XXH128 is the 128-bit variant of XXH3.
NextSSL includes XXH32, XXH64, XXH3 (64-bit) and XXH128. All pass the SMHasher quality tests, and XXH3 accepts a seed or custom secret. XXH3 and XXH128 are the recommended variants for new code. None of this provides security: the function has no secret key, and anyone can compute or deliberately collide its outputs.
History
2012–2019xxHash released by Yann Collet
XXH3 and XXH128 introduced
Security notes
xxHash is explicitly non-cryptographic. Collisions and multi-collisions can be constructed deliberately, so it must not be used for authentication, signatures or protecting hash tables from adversarial input unless combined with additional defences.
Typical uses
Variants in NextSSL
4| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| XXH3 xxh3 |
standard | out 8 | xxHash (Yann Collet), NON-cryptographic | safe |
| Xxhash32 xxhash32 |
standard | out 4 | xxHash (Yann Collet), NON-cryptographic | safe |
| Xxhash64 xxhash64 |
standard | out 8 | xxHash (Yann Collet), NON-cryptographic | safe |
| XXH128 xxh128 |
unverified | out 16 | xxHash (Yann Collet), NON-cryptographic | root |
Frequently asked questions
Which xxHash variants does NextSSL include?
NextSSL registers 4 xxHash variants: xxh3, xxhash32, xxhash64, xxh128.
Families with similar names
Other checksums and non-cryptographic hashes
All 130Related
Google's fast non-cryptographic string hash, optimised for short strings on x86-64
MurmurHash3Austin Appleby's widely used multiply-rotate hash for hash tables
wyhashWang Yi's compact, very fast hash based on 64x64-to-128-bit multiplication
BLAKE3A Merkle-tree hash over BLAKE2s rounds, designed for parallel speed and unlimited output
BLAKE3A Merkle-tree hash over BLAKE2s rounds, designed for parallel speed and unlimited output
SipHashA short-input keyed PRF designed to protect hash tables from flooding attacks