Pick an algorithm
Which hash do you need?
All three run client-side in milliseconds. Pick by output size and use case.
Background
What is a hash function?
A cryptographic hash takes any input and produces a fixed-size, irreversible fingerprint. The same input always yields the same hash; the smallest change in input produces a completely different hash. They're used for checksums, password storage, digital signatures, and content addressing.
| Algorithm | Size | Security | Use for |
|---|---|---|---|
| MD5 | 128 bits | Broken | Non-security checksums only |
| SHA-1 | 160 bits | Deprecated | Legacy git, retired TLS |
| SHA-256 | 256 bits | Recommended | Signatures, TLS, blockchains |
HEADS UP
Read up on password hashing
Hashing passwords? Don't use these.
MD5 and SHA-* are fast on purpose — exactly what you don't want for password storage. Use bcrypt, scrypt, or argon2 instead.