MD5 calculates mathematical steps to ensure no two inputs produce the same output (which it fails at now, but the math is still there). xxHash assumes the input isn't malicious and just shuffles bits as quickly as the CPU allows.
You want a modern, well-maintained algorithm optimized for 64-bit systems. Use MD5 if: xxhash vs md5
Understanding the difference between these two requires looking at their original design goals: one was built for security (and failed), while the other was built for speed (and succeeded). Core Differences at a Glance xxHash (XXH3/XXH128) Cryptographic (broken) Non-cryptographic Primary Goal Security & Integrity Maximum Performance Extremely High (RAM speed) Collision Resistance Vulnerable to attacks Excellent for random data Common Use Case Legacy checksums Caching, databases, real-time data 1. The Performance Gap The most striking difference is speed. is designed to operate at the limits of memory bandwidth. : Modern variants like MD5 calculates mathematical steps to ensure no two