Skip to content
uencoder

xxHash

xxHash is an extremely fast non-cryptographic hash designed by Yann Collet, approaching memory bandwidth limits on modern CPUs, used with LZ4/Zstd compression.

Purpose

Provides RAM-bandwidth-class ultra-fast non-cryptographic hashing for high-performance checksums and sharding.

Mechanism

XXH32/XXH64 maintain 4 accumulators, one round per 16 bytes: acc = acc ⊕ (input × prime); acc = rotl(acc, 13) × prime. Accumulators are merged and avalanched at the end. XXH3 uses AES hardware acceleration for even more speed.

Use cases

  • Zstd/LZ4 compression verification
  • Rust xxHash crate
  • High-frequency hash tables
  • Game engine internals

Examples

  • Input
    hello
    Output
    0x391c7cb6

    XXH32

Common errors

Using xxHash for cryptographic authentication
xxHash is not cryptographic; use HMAC

Related terms

Related tools

References