The short answer
Common hashing algorithms include SHA-256, SHA-3, BLAKE2, MD5, SHA-1, CRC32, MurmurHash, xxHash and FNV. They are not interchangeable. Each was designed for a different job, and some are unsafe for security work. If the basic idea is new, start with what is the hash function in hashing.
Cryptographic hash functions
These are built so that it is very hard to forge data or to find two inputs with the same hash. They show up in checking downloaded files, digital signatures and many security protocols.
- SHA-256 and SHA-3 are widely used and belong to standard families (SHA-2 and SHA-3).
- BLAKE2 and BLAKE3 are newer designs that aim to be fast while still resisting attack.
Older functions to avoid for security
- MD5 and SHA-1 still appear in old checksums, file formats and legacy systems. Collision attacks are known for both, so they should not be used where someone might try to forge data.
They can still help catch accidental corruption in some settings, but they do not protect against deliberate tampering.
Non-cryptographic hash functions
These aim for speed and an even spread of values, not resistance to attackers.
- CRC32 is used for error detection in network and storage formats. It catches accidental changes, not deliberate ones.
- MurmurHash, xxHash and FNV are fast functions used in hash tables and for spreading data across servers.
The consistent hashing algorithm needs a hash that spreads values evenly, which is why fast non-cryptographic functions are common in that setting. It does not need a cryptographic hash.
Password hashing functions
Passwords call for their own tools. bcrypt, scrypt and Argon2 are deliberately slow and are designed for storing passwords. A plain SHA-256 is not a password hash, because it is fast enough for attackers to try very large numbers of guesses. Use a dedicated password hashing function and follow current guidance, such as the OWASP password storage recommendations.
How to choose
Start with the job:
- Security or tamper checks: use a current cryptographic function such as SHA-256 or SHA-3, and check the guidance for your situation.
- Hash tables and spreading data across servers: a fast non-cryptographic function is often enough.
- Storing passwords: use a password hashing function, not a general-purpose hash.
Recommendations change over time, so check current guidance before you rely on any one choice.