Checksum family

xxHash

Yann Collet's extremely fast non-cryptographic hash family: XXH32, XXH64, XXH3 and XXH128

standard 4 variants xxHash specification

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–2019
  1. xxHash released by Yann Collet

  2. 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

Fast data checksums in compression formatsHash tables and deduplicationBuild-system caching

Variants in NextSSL

4
AlgorithmTierSizes (bytes)StandardsAPI
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.