<!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 suitable for hash_hmac</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.hash-hkdf.html">hash_hkdf</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.hash-hmac-file.html">hash_hmac_file</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-hmac-algos" class="refentry"> <div class="refnamediv"> <h1 class="refname">hash_hmac_algos</h1> <p class="verinfo">(PHP 7 >= 7.2.0)</p><p class="refpurpose"><span class="refname">hash_hmac_algos</span> — <span class="dc-title">Return a list of registered hashing algorithms suitable for hash_hmac</span></p> </div> <div class="refsect1 description" id="refsect1-function.hash-hmac-algos-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>hash_hmac_algos</strong></span> ( <span class="methodparam">void</span> )</div> </div> <div class="refsect1 returnvalues" id="refsect1-function.hash-hmac-algos-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a numerically indexed array containing the list of supported hashing algorithms suitable for <span class="function"><a href="function.hash-hmac.html" class="function">hash_hmac()</a></span>. </p> </div> <div class="refsect1 examples" id="refsect1-function.hash-hmac-algos-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-927"> <p><strong>Example #1 <span class="function"><strong>hash_hmac_algos()</strong></span> example</strong></p> <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_hmac_algos</span><span style="color: #007700">());</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/224 [8] => sha512/256 [9] => sha512 [10] => sha3-224 [11] => sha3-256 [12] => sha3-384 [13] => sha3-512 [14] => ripemd128 [15] => ripemd160 [16] => ripemd256 [17] => ripemd320 [18] => whirlpool [19] => tiger128,3 [20] => tiger160,3 [21] => tiger192,3 [22] => tiger128,4 [23] => tiger160,4 [24] => tiger192,4 [25] => snefru [26] => snefru256 [27] => gost [28] => gost-crypto [29] => haval128,3 [30] => haval160,3 [31] => haval192,3 [32] => haval224,3 [33] => haval256,3 [34] => haval128,4 [35] => haval160,4 [36] => haval192,4 [37] => haval224,4 [38] => haval256,4 [39] => haval128,5 [40] => haval160,5 [41] => haval192,5 [42] => haval224,5 [43] => haval256,5 ) </pre></div> </div> </div> </div> <div class="refsect1 notes" id="refsect1-function.hash-hmac-algos-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Before PHP 7.2.0 the only means to get a list of supported hash algorithms has been to call <span class="function"><a href="function.hash-algos.html" class="function">hash_algos()</a></span> which also returns hash algorithms that are not suitable for <span class="function"><a href="function.hash-hmac.html" class="function">hash_hmac()</a></span>. </p> </p></blockquote> </div> <div class="refsect1 seealso" id="refsect1-function.hash-hmac-algos-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"><span class="function"><a href="function.hash-hmac.html" class="function" rel="rdfs-seeAlso">hash_hmac()</a> - Generate a keyed hash value using the HMAC method</span></li> <li class="member"><span class="function"><a href="function.hash-algos.html" class="function" rel="rdfs-seeAlso">hash_algos()</a> - Return a list of registered hashing algorithms</span></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.hash-hkdf.html">hash_hkdf</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.hash-hmac-file.html">hash_hmac_file</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>