Cyan4973/xxHash logo

Cyan4973/xxHash

Free

Extremely fast non-cryptographic hash algorithm

FreeFree tier
Inputs: file
Type
Open Source

About Cyan4973/xxHash

xxHash is an extremely fast non-cryptographic hash algorithm designed to process data at RAM speed limits. It is highly portable and produces identical hashes across all platforms, regardless of endianness. The library includes multiple algorithms: XXH32 for 32-bit hashes using 32-bit arithmetic, XXH64 for 64-bit hashes, and XXH3 (since v0.8.0) which generates 64-bit or 128-bit hashes using vectorized arithmetic. XXH3's 128-bit variant is called XXH128. All variants successfully pass the SMHasher test suite, which evaluates collision, dispersion, and randomness quality. Additionally, XXH3 is optimized for excellent performance on both long and small inputs, making it ideal for hash tables, bloom filters, and other data structures where speed and quality are essential.

Key Features

Processes data at RAM speed limits
Highly portable with identical hashes across all platforms (little/big endian)
Includes algorithms: XXH32 (32-bit), XXH64 (64-bit), XXH3 (64/128-bit via vectorized arithmetic)
All variants pass the SMHasher test suite for collision, dispersion, and randomness quality
Optimized for excellent performance on both long and small inputs
Open source (BSD-2-Clause license) with a wide community

Pros & Cons

Pros
  • Extremely high speed, often limited by RAM bandwidth
  • Portable across platforms with consistent output
  • High quality hashing proven by SMHasher test suite
  • Excellent performance on small data inputs
  • Offers multiple hash sizes (32, 64, 128-bit) to suit different needs
Cons
  • Non-cryptographic; not suitable for security-sensitive applications (e.g., password hashing, digital signatures)
  • Not designed to resist collision attacks or preimage attacks
  • May be outperformed by cryptographic hashes in security-critical contexts due to design trade-offs

Best For

Hash tables and hash-based data structuresBloom filters and probabilistic data structuresNon-cryptographic integrity checks and deduplicationHigh-speed data processing pipelines where hashing is a bottleneckFile and data fingerprinting for quick comparison

FAQ

What algorithms does xxHash include?
xxHash includes XXH32 (32-bit), XXH64 (64-bit), and XXH3 which produces 64-bit or 128-bit hashes (XXH128). XXH3 uses vectorized arithmetic for performance.
Is xxHash a cryptographic hash function?
No, xxHash is a non-cryptographic hash algorithm. It prioritizes speed and quality for general-purpose hashing, not security against attacks.
How fast is xxHash compared to other hash functions?
xxHash is extremely fast, processing at RAM speed limits. According to benchmarks, XXH3 (SSE2) reaches 31.5 GB/s on 64-bit hashes, outperforming many other non-cryptographic and cryptographic hashes like City64, SpookyHash, and Murmur3.
Is xxHash portable across different platforms?
Yes, the code is highly portable and produces identical hash values across all platforms, including little-endian and big-endian systems.