Website · API documentation · xxhsum manual · Format specification
xxHash is an extremely fast non-cryptographic hash algorithm, working at RAM speed limits. It is highly portable and produces identical hashes on all platforms, including little- and big-endian systems. Once finalized, algorithm outputs remain stable across xxHash releases.
The library includes the following algorithms:
- XXH32 generates 32-bit hashes, using 32-bit arithmetic.
- XXH64 generates 64-bit hashes, using 64-bit arithmetic.
- XXH3, available since v0.8.0, generates 64-bit or 128-bit hashes using vectorized arithmetic. The 128-bit variant is called XXH128.
For new applications, XXH3_64bits() is the recommended default. Use
XXH3_128bits() when a 128-bit hash is required.
The benchmarked reference system uses an Intel i7-9700K CPU running Ubuntu
x64 20.04. The open source benchmark program is compiled with Clang v10.0
using -O3.
| Hash Name | Width | Bandwidth | Small Data Velocity | Comment |
|---|---|---|---|---|
| XXH3 (AVX2) | 64 | 59.4 GB/s | 133.1 | |
| XXH128 (AVX2) | 128 | 57.9 GB/s | 118.1 | |
| XXH3 (SSE2) | 64 | 31.5 GB/s | 133.1 | |
| XXH128 (SSE2) | 128 | 29.6 GB/s | 118.1 | |
| memcpy, from RAM | N/A | 28.0 GB/s | N/A | for reference |
| City64 | 64 | 22.0 GB/s | 76.6 | |
| T1ha2 | 64 | 22.0 GB/s | 99.0 | Slightly worse collisions |
| City128 | 128 | 21.7 GB/s | 57.7 | |
| XXH64 | 64 | 19.4 GB/s | 71.0 | |
| SpookyHash | 64 | 19.3 GB/s | 53.2 | |
| Mum | 64 | 18.0 GB/s | 67.0 | Slightly worse collisions |
| XXH32 | 32 | 9.7 GB/s | 71.9 | |
| City32 | 32 | 9.1 GB/s | 66.0 | |
| Murmur3 | 32 | 3.9 GB/s | 56.1 | |
| SipHash | 64 | 3.0 GB/s | 43.2 | |
| FNV64 | 64 | 1.2 GB/s | 62.7 | Poor avalanche properties |
| Blake2 | 256 | 1.1 GB/s | 5.1 | Cryptographic |
| SHA1 | 160 | 0.8 GB/s | 5.6 | Cryptographic but broken |
| MD5 | 128 | 0.6 GB/s | 7.8 | Cryptographic but broken |
For current measurements on additional platforms, see the benchmarks on xxhash.com.
Note 1: Small data velocity is a rough evaluation of an algorithm's efficiency on small data. For more detailed analysis, see the next section.
Note 2: Some algorithms feature faster than RAM