All PHP hash algorithmsAll PHP 8.5 hash algorithms

Choosing the right hashing algorithm is difficult, balancing the need for security, speed, and reliability. PHP offers a almost 60 built-in hashing options, but not all are created equal : some are industry standards for cryptographic security, while others are optimized for lightning-fast non-cryptographic tasks like caching or checksums; some are just here for legacy reasons. This blog post provides a comprehensive, categorized guide to every algorithm available in PHP, helping you navigate the trade-offs between legacy compatibility and modern security to ensure you’re always using the right tool for the job.

 

 

 

 

Hashing families

MD

md2

More details

md2 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('md2', 'The quick brown fox jumps over the lazy dog');
  //03d85a0d629d2c442e987525319fc471
?>

Strengths: fast, widely used.

Usage: non-cryptographic caching, legacy identifier generation.

md4

More details

md4 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('md4', 'The quick brown fox jumps over the lazy dog');
  //1bee69a46ba811185c194762abaeae90
?>

Strengths: fast, widely used.

Usage: non-cryptographic caching, legacy identifier generation.

md5

More details

md5 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('md5', 'The quick brown fox jumps over the lazy dog');
  //9e107d9d372bb6826bd81d3542a419d6
?>

Strengths: fast, widely used.

Usage: non-cryptographic caching, legacy identifier generation.

SHA-1

sha1

More details

sha1 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('sha1', 'The quick brown fox jumps over the lazy dog');
  //2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
?>

Strengths: legacy compatibility.

Usage: non-cryptographic caching, legacy identifier generation.

SHA-2

sha224

More details

<?php 
  hash('sha224', 'The quick brown fox jumps over the lazy dog');
  //730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525
?>

Strengths: high security, industry standard.

Usage: cryptographic security, digital signatures.

sha256

More details

<?php 
  hash('sha256', 'The quick brown fox jumps over the lazy dog');
  //d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
?>

Strengths: high security, industry standard.

Usage: cryptographic security, digital signatures.

sha384

More details

<?php 
  hash('sha384', 'The quick brown fox jumps over the lazy dog');
  //ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1
?>

Strengths: high security, industry standard.

Usage: cryptographic security, digital signatures.

sha512/224

More details

<?php 
  hash('sha512/224', 'The quick brown fox jumps over the lazy dog');
  //944cd2847fb54558d4775db0485a50003111c8e5daa63fe722c6aa37
?>

Strengths: high security, industry standard.

Usage: cryptographic security, digital signatures.

sha512/256

More details

<?php 
  hash('sha512/256', 'The quick brown fox jumps over the lazy dog');
  //dd9d67b371519c339ed8dbd25af90e976a1eeefd4ad3d889005e532fc5bef04d
?>

Strengths: high security, industry standard.

Usage: cryptographic security, digital signatures.

sha512

More details

<?php 
  hash('sha512', 'The quick brown fox jumps over the lazy dog');
  //07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6
?>

Strengths: high security, industry standard.

Usage: cryptographic security, digital signatures.

SHA-3

sha3-224

More details

<?php 
  hash('sha3-224', 'The quick brown fox jumps over the lazy dog');
  //d15dadceaa4d5d7bb3b48f446421d542e08ad8887305e28d58335795
?>

Strengths: modern, resistant to length extension attacks.

Usage: cryptographic security, future-proof hashing.

sha3-256

More details

<?php 
  hash('sha3-256', 'The quick brown fox jumps over the lazy dog');
  //69070dda01975c8c120c3aada1b282394e7f032fa9cf32f4cb2259a0897dfc04
?>

Strengths: modern, resistant to length extension attacks.

Usage: cryptographic security, future-proof hashing.

sha3-384

More details

<?php 
  hash('sha3-384', 'The quick brown fox jumps over the lazy dog');
  //7063465e08a93bce31cd89d2e3ca8f602498696e253592ed26f07bf7e703cf328581e1471a7ba7ab119b1a9ebdf8be41
?>

Strengths: modern, resistant to length extension attacks.

Usage: cryptographic security, future-proof hashing.

sha3-512

More details

<?php 
  hash('sha3-512', 'The quick brown fox jumps over the lazy dog');
  //01dedd5de4ef14642445ba5f5b97c15e47b9ad931326e4b0727cd94cefc44fff23f07bf543139939b49128caf436dc1bdee54fcb24023a08d9403f9b4bf0d450
?>

Strengths: modern, resistant to length extension attacks.

Usage: cryptographic security, future-proof hashing.

RIPEMD

ripemd128

More details

ripemd128 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('ripemd128', 'The quick brown fox jumps over the lazy dog');
  //3fa9b57f053c053fbe2735b2380db596
?>

Strengths: alternative to sha.

Usage: cryptographic security (160+ bits), blockchain (ripemd-160).

ripemd160

More details

<?php 
  hash('ripemd160', 'The quick brown fox jumps over the lazy dog');
  //37f332f68db77bd9d7edd4969571ad671cf9dd3b
?>

Strengths: alternative to sha.

Usage: cryptographic security (160+ bits), blockchain (ripemd-160).

ripemd256

More details

ripemd256 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('ripemd256', 'The quick brown fox jumps over the lazy dog');
  //c3b0c2f764ac6d576a6c430fb61a6f2255b4fa833e094b1ba8c1e29b6353036f
?>

Strengths: alternative to sha.

Usage: cryptographic security (160+ bits), blockchain (ripemd-160).

ripemd320

More details

ripemd320 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('ripemd320', 'The quick brown fox jumps over the lazy dog');
  //e7660e67549435c62141e51c9ab1dcc3b1ee9f65c0b3e561ae8f58c5dba3d21997781cd1cc6fbc34
?>

Strengths: alternative to sha.

Usage: cryptographic security (160+ bits), blockchain (ripemd-160).

Whirlpool

whirlpool

More details

<?php 
  hash('whirlpool', 'The quick brown fox jumps over the lazy dog');
  //b97de512e91e3828b40d2b0fdce9ceb3c4a71f9bea8d88e75c4fa854df36725fd2b52eb6544edcacd6f8beddfea403cb55ae31f03ad62a5ef54e42ee82c3fb35
?>

Strengths: large 512-bit hash, based on aes.

Usage: high-security cryptographic hashing.

Tiger

tiger128,3

More details

<?php 
  hash('tiger128,3', 'The quick brown fox jumps over the lazy dog');
  //6d12a41e72e644f017b6f0e2f7b44c62
?>

Strengths: designed for 64-bit systems.

Usage: fast hashing on 64-bit systems.

tiger160,3

More details

<?php 
  hash('tiger160,3', 'The quick brown fox jumps over the lazy dog');
  //6d12a41e72e644f017b6f0e2f7b44c6285f06dd5
?>

Strengths: designed for 64-bit systems.

Usage: fast hashing on 64-bit systems.

tiger192,3

More details

<?php 
  hash('tiger192,3', 'The quick brown fox jumps over the lazy dog');
  //6d12a41e72e644f017b6f0e2f7b44c6285f06dd5d2c5b075
?>

Strengths: designed for 64-bit systems.

Usage: fast hashing on 64-bit systems.

tiger128,4

More details

<?php 
  hash('tiger128,4', 'The quick brown fox jumps over the lazy dog');
  //c1f3a704e9f6267e9f75fa47191f83c3
?>

Strengths: designed for 64-bit systems.

Usage: fast hashing on 64-bit systems.

tiger160,4

More details

<?php 
  hash('tiger160,4', 'The quick brown fox jumps over the lazy dog');
  //c1f3a704e9f6267e9f75fa47191f83c354100a04
?>

Strengths: designed for 64-bit systems.

Usage: fast hashing on 64-bit systems.

tiger192,4

More details

<?php 
  hash('tiger192,4', 'The quick brown fox jumps over the lazy dog');
  //c1f3a704e9f6267e9f75fa47191f83c354100a04c4f1dc6f
?>

Strengths: designed for 64-bit systems.

Usage: fast hashing on 64-bit systems.

Snefru

snefru

More details

snefru is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('snefru', 'The quick brown fox jumps over the lazy dog');
  //674caa75f9d8fd2089856b95e93a4fb42fa6c8702f8980e11d97a142d76cb358
?>

Strengths: historical interest.

Usage: historical interest only.

snefru256

More details

snefru256 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('snefru256', 'The quick brown fox jumps over the lazy dog');
  //674caa75f9d8fd2089856b95e93a4fb42fa6c8702f8980e11d97a142d76cb358
?>

Strengths: historical interest.

Usage: historical interest only.

GOST

gost

More details

gost is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('gost', 'The quick brown fox jumps over the lazy dog');
  //77b7fa410c9ac58a25f49bca7d0468c9296529315eaca76bd1a10f376d1f4294
?>

Strengths: russian national standard.

Usage: cryptographic security (standard-specific).

gost-crypto

More details

<?php 
  hash('gost-crypto', 'The quick brown fox jumps over the lazy dog');
  //9004294a361a508c586fe53d1f1b02746765e71b765472786e4770d565830a76
?>

Strengths: russian national standard.

Usage: cryptographic security (standard-specific).

Checksum

adler32

More details

adler32 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('adler32', 'The quick brown fox jumps over the lazy dog');
  //5bdc0fda
?>

Strengths: faster than crc32 but less reliable.

Usage: checksum, error detection.

crc32

More details

crc32 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('crc32', 'The quick brown fox jumps over the lazy dog');
  //61ee9d45
?>

Strengths: error detection in data transmission.

Usage: checksum, error detection.

crc32b

More details

crc32b is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('crc32b', 'The quick brown fox jumps over the lazy dog');
  //414fa339
?>

Strengths: error detection in data transmission.

Usage: checksum, error detection.

crc32c

More details

crc32c is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('crc32c', 'The quick brown fox jumps over the lazy dog');
  //22620404
?>

Strengths: error detection in data transmission.

Usage: checksum, error detection.

FNV

fnv132

More details

fnv132 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('fnv132', 'The quick brown fox jumps over the lazy dog');
  //e9c86c6e
?>

Strengths: low collision rate, simple.

Usage: fast hash table keys, non-cryptographic identifier generation.

fnv1a32

More details

fnv1a32 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('fnv1a32', 'The quick brown fox jumps over the lazy dog');
  //048fff90
?>

Strengths: low collision rate, simple.

Usage: fast hash table keys, non-cryptographic identifier generation.

fnv164

More details

fnv164 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('fnv164', 'The quick brown fox jumps over the lazy dog');
  //a8b2f3117de37ace
?>

Strengths: low collision rate, simple.

Usage: fast hash table keys, non-cryptographic identifier generation.

fnv1a64

More details

fnv1a64 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('fnv1a64', 'The quick brown fox jumps over the lazy dog');
  //f3f9b7f5e7e47110
?>

Strengths: low collision rate, simple.

Usage: fast hash table keys, non-cryptographic identifier generation.

Jenkins

joaat

More details

joaat is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('joaat', 'The quick brown fox jumps over the lazy dog');
  //519e91f5
?>

Strengths: fast non-cryptographic hash.

Usage: fast non-cryptographic identifier generation.

MurmurHash

murmur3a

More details

murmur3a is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('murmur3a', 'The quick brown fox jumps over the lazy dog');
  //2e4ff723
?>

Strengths: fast non-cryptographic hash for hash tables.

Usage: high-performance hash table indexing, caching.

murmur3c

More details

murmur3c is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('murmur3c', 'The quick brown fox jumps over the lazy dog');
  //2f1583c3ecee2c675d7bf66ce5e91d2c
?>

Strengths: fast non-cryptographic hash for hash tables.

Usage: high-performance hash table indexing, caching.

murmur3f

More details

murmur3f is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('murmur3f', 'The quick brown fox jumps over the lazy dog');
  //e34bbc7bbc071b6c7a433ca9c49a9347
?>

Strengths: fast non-cryptographic hash for hash tables.

Usage: high-performance hash table indexing, caching.

xxHash

xxh32

More details

xxh32 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('xxh32', 'The quick brown fox jumps over the lazy dog');
  //e85ea4de
?>

Strengths: extremely fast non-cryptographic hash.

Usage: extremely fast non-cryptographic data processing, caching.

xxh64

More details

xxh64 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('xxh64', 'The quick brown fox jumps over the lazy dog');
  //0b242d361fda71bc
?>

Strengths: extremely fast non-cryptographic hash.

Usage: extremely fast non-cryptographic data processing, caching.

xxh3

More details

xxh3 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('xxh3', 'The quick brown fox jumps over the lazy dog');
  //ce7d19a5418fb365
?>

Strengths: extremely fast non-cryptographic hash.

Usage: extremely fast non-cryptographic data processing, caching.

xxh128

More details

xxh128 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('xxh128', 'The quick brown fox jumps over the lazy dog');
  //ddd650205ca3e7fa24a1cc2e3a8a7651
?>

Strengths: extremely fast non-cryptographic hash.

Usage: extremely fast non-cryptographic data processing, caching.

Haval

haval128,3

More details

haval128,3 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval128,3', 'The quick brown fox jumps over the lazy dog');
  //713502673d67e5fa557629a71d331945
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval160,3

More details

haval160,3 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval160,3', 'The quick brown fox jumps over the lazy dog');
  //b338ac397e8bccadcccd96549cadd4882d834107
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval192,3

More details

haval192,3 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval192,3', 'The quick brown fox jumps over the lazy dog');
  //58e6ced002e311172483d434ba738ad033e7fa950e431503
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval224,3

More details

haval224,3 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval224,3', 'The quick brown fox jumps over the lazy dog');
  //e1d5792306f56b22419662b06d1885a66dca3eba01f53274c89aeaeb
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval256,3

More details

haval256,3 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval256,3', 'The quick brown fox jumps over the lazy dog');
  //9446028f42b3768a41bd873ca69b0c006341d986613567f39eb61f96ca683300
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval128,4

More details

haval128,4 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval128,4', 'The quick brown fox jumps over the lazy dog');
  //6eece560a2e8d6b919e81fe91b0e7156
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval160,4

More details

haval160,4 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval160,4', 'The quick brown fox jumps over the lazy dog');
  //6e739d01f5739ceed94da1a115b52d5951280560
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval192,4

More details

haval192,4 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval192,4', 'The quick brown fox jumps over the lazy dog');
  //228ee09bc7e36151c6f285f558e6aede66ad38c8341592b9
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval224,4

More details

haval224,4 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval224,4', 'The quick brown fox jumps over the lazy dog');
  //dddd6689885f6db4ad91e35a35e1f4498446510df798d4fd54b8654f
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval256,4

More details

haval256,4 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval256,4', 'The quick brown fox jumps over the lazy dog');
  //c0d4c6ea514105fd1a9c38a238553fb7fa21d4127eb1a3035a75ce9d06a83d96
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval128,5

More details

haval128,5 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval128,5', 'The quick brown fox jumps over the lazy dog');
  //696f02111f2e1da5c21d50eb782b7e8f
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval160,5

More details

haval160,5 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval160,5', 'The quick brown fox jumps over the lazy dog');
  //ecce9fa8a428866304ff082af2f9062637d36b23
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval192,5

More details

haval192,5 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval192,5', 'The quick brown fox jumps over the lazy dog');
  //023d045f75d4bf051fd6e50f7b7417bf9949c4b5d2b4b7ef
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval224,5

More details

haval224,5 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval224,5', 'The quick brown fox jumps over the lazy dog');
  //03d953298c8e56b46385c6761cd4b2e377889a75c97eaea475421c73
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).

haval256,5

More details

haval256,5 is not a secure hashing anymore. Do not use it for security sensitive operations.

<?php 
  hash('haval256,5', 'The quick brown fox jumps over the lazy dog');
  //b89c551cdfe2e06dbd4cea2be1bc7d557416c58ebb4d07cbc94e49f710c55be4
?>

Strengths: variable length and rounds.

Usage: flexible cryptographic hashing (variable output).