If you are building a modern application and need to check if a file was copied correctly or index a database, is the clear winner. Only reach for MD5 if you are forced to by a legacy requirement or a specific third-party API.
: The newest, fastest version, optimized for modern CPU features like SIMD (AVX2/SSE2) . xxhash vs md5
Extremely stable and widely used in big data (Presto, RocksDB, etc.). If you are building a modern application and
is designed to run at RAM speed limits . Modern versions like XXH3 can reach speeds of over 30 GB/s on modern CPUs. Extremely stable and widely used in big data
| Feature | MD5 | xxHash (xxHash64) | | :--- | :--- | :--- | | | Cryptographic (Broken) | Non-Cryptographic | | Hash Size | 128 bits | 64 bits (standard) | | Output Format | Hex string (32 chars) | Hex string / Integer | | Speed (Approx.) | ~500 MB/s - 1 GB/s | ~10 GB/s - 20 GB/s (RAM speed) | | Collision Probability | Low (but mathematically broken) | Low (very good for 64-bit) | | CPU Usage | Higher (complex math) | Lower (simple bit shifts) | | Portability | Available on virtually every OS | Requires library (but widely supported) | | Security | Vulnerable (Collision attacks easy) | Vulnerable (Designed to be fast, not secure) |