Where MD5 is used
- File checksums published next to downloads
- Cache keys and ETags
- Deduplicating files (non-adversarial)
Command line
md5sum file.txt # Linux md5 file.txt # macOS echo -n "text" | md5sum # a string, no trailing newline
In code
# Python
import hashlib
hashlib.md5(b"text").hexdigest()
// Node.js
require('crypto').createHash('md5').update('text').digest('hex')Hashing is deterministic and one-way: the same bytes always give the same 128-bit value, and a one-character change scrambles it completely — try the avalanche demo.