What is Hashing?
A hash function takes any input and produces a fixed-length string of characters. The same input always produces the same hash, but even a tiny change in input creates a completely different output. Hash functions are one-way — you cannot reverse a hash to get the original input.
Which Algorithm Should You Use?
- MD5 (128-bit) — Fast but broken for security. Use only for checksums.
- SHA-1 (160-bit) — Deprecated for security since 2017. Legacy compatibility only.
- SHA-256 (256-bit) — Industry standard. Used in TLS, Bitcoin, and digital signatures.
- SHA-512 (512-bit) — Stronger variant. Better performance on 64-bit processors.
Common Use Cases
- Verifying file integrity (download checksums)
- Password storage (with salt, using bcrypt/argon2 instead)
- Digital signatures and certificates
- Data deduplication
- Blockchain and cryptocurrency