2026-05-18 · 4 min read
Secure Hash Algorithm (SHA) family functions take arbitrary input and produce a fixed-length digest. The same input always yields the same digest; tiny input changes produce completely different outputs.
Common algorithms
Choose the algorithm your spec requires. Mixing algorithms without reason adds confusion.
- SHA-256 — 256-bit digest, widely used in APIs
- SHA-512 — longer digest, similar security margin
What hashing is not
Hashing is one-way—you cannot recover the input from the digest. It is not encryption. For passwords, use salted slow hashes (bcrypt, Argon2), not raw SHA alone.