PHP Registered Hashing Algorithms and their Hashed Value Length

PHP Registered Hashing Algorithms

PHP has a many hashing functions like sha1(), hash(), md5(), etc that can be used to hash a string/number based on certain algorithms i.e. “sha1”, “sha256”, “md5”, etc. You can use hash_algos() function to check a list of registered hashing algorithms. All these function takes a string/number as an argument and output an Alpha-Numeric hashed string of certain length.

hash_algos() — Return a list of registered hashing algorithms. Currently PHP supports 46 hashing algorithms. hash_algos() function returns a numerically indexed array containing the list of supported hashing algorithms. Each hashing algorithm has a specific hashed value length.


PHP Hash Algorithms Name & Length

S.No. Algorithm Name Length
1 md2 32
2 md4 32
3 md5 32
4 sha1 40
5 sha224 56
6 sha256 64
7 sha384 96
8 sha512 128
9 ripemd128 32
10 ripemd160 40
11 ripemd256 64
12 ripemd320 80
13 whirlpool 128
14 tiger128,3 32
15 tiger160,3 40
16 tiger192,3 48
17 tiger128,4 32
18 tiger160,4 40
19 tiger192,4 48
20 snefru 64
21 snefru256 64
22 gost 64
23 gost-crypto 64
24 adler32 8
25 crc32 8
26 crc32b 8
27 fnv132 8
28 fnv1a32 8
29 fnv164 16
30 fnv1a64 16
31 joaat 8
32 haval128,3 32
33 haval160,3 40
34 haval192,3 48
35 haval224,3 56
36 haval256,3 64
37 haval128,4 32
38 haval160,4 40
39 haval192,4 48
40 haval224,4 56
41 haval256,4 64
42 haval128,5 32
43 haval160,5 40
44 haval192,5 48
45 haval224,5 56
46 haval256,5 64

Leave a Reply