<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Return a list of registered hashing algorithms</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.hash.html">Hash Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.hash-copy.html">hash_copy</a></div> <div class="up"><a href="ref.hash.html">Hash Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.hash-algos" class="refentry"> <div class="refnamediv"> <h1 class="refname">hash_algos</h1> <p class="verinfo">(PHP 5 >= 5.1.2, PHP 7, PECL hash >= 1.1)</p><p class="refpurpose"><span class="refname">hash_algos</span> — <span class="dc-title">Return a list of registered hashing algorithms</span></p> </div> <div class="refsect1 description" id="refsect1-function.hash-algos-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>hash_algos</strong></span> ( <span class="methodparam">void</span> )</div> </div> <div class="refsect1 returnvalues" id="refsect1-function.hash-algos-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a numerically indexed array containing the list of supported hashing algorithms. </p> </div> <div class="refsect1 changelog" id="refsect1-function.hash-algos-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>7.1.0</td> <td> Support for sha512/224, sha512/256, sha3-224, sha3-256, sha3-384 and sha3-512 has been added. </td> </tr> <tr> <td>5.6.0</td> <td> Support for gost-crypto was added. This implements the GOST hash function using the CryptoPro S-box tables as specified by <a href="http://www.faqs.org/rfcs/rfc4357" class="link external">» RFC 4357, section 11.2</a>. </td> </tr> <tr> <td>5.4.0</td> <td>Support for joaat, fnv132 and fnv164 was added. Support for Salsa10 and Salsa20 was removed.</td> </tr> <tr> <td>5.3.0</td> <td>Support for md2, ripemd256, ripemd320, salsa10, salsa20, snefru256 and sha224 was added</td> </tr> </tbody> </table> </p> </div> <div class="refsect1 examples" id="refsect1-function.hash-algos-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-921"> <p><strong>Example #1 <span class="function"><strong>hash_algos()</strong></span> example</strong></p> <div class="example-contents"><p> As of PHP 5.6.0, <span class="function"><strong>hash_algos()</strong></span> will return the following list of algorithm names. </p></div> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">hash_algos</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Array ( [0] => md2 [1] => md4 [2] => md5 [3] => sha1 [4] => sha224 [5] => sha256 [6] => sha384 [7] => sha512 [8] => ripemd128 [9] => ripemd160 [10] => ripemd256 [11] => ripemd320 [12] => whirlpool [13] => tiger128,3 [14] => tiger160,3 [15] => tiger192,3 [16] => tiger128,4 [17] => tiger160,4 [18] => tiger192,4 [19] => snefru [20] => snefru256 [21] => gost [22] => gost-crypto [23] => adler32 [24] => crc32 [25] => crc32b [26] => fnv132 [27] => fnv1a32 [28] => fnv164 [29] => fnv1a64 [30] => joaat [31] => haval128,3 [32] => haval160,3 [33] => haval192,3 [34] => haval224,3 [35] => haval256,3 [36] => haval128,4 [37] => haval160,4 [38] => haval192,4 [39] => haval224,4 [40] => haval256,4 [41] => haval128,5 [42] => haval160,5 [43] => haval192,5 [44] => haval224,5 [45] => haval256,5 ) </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.hash-algos-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"><span class="function"><a href="function.hash-hmac-algos.html" class="function" rel="rdfs-seeAlso">hash_hmac_algos()</a> - Return a list of registered hashing algorithms suitable for hash_hmac</span></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.hash.html">Hash Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.hash-copy.html">hash_copy</a></div> <div class="up"><a href="ref.hash.html">Hash Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>