Mhash Functions
mhash
&reftitle.intro;
These functions are intended to work with mhash. Mhash can be used to create checksums,
message digests, message authentication codes, and more.
This is an interface to the mhash library. mhash supports a wide
variety of hash algorithms such as MD5, SHA1, GOST, and many
others. For a complete list of supported hashes, refer to the
documentation of mhash. The general rule is that you can access
the hash algorithm from PHP with MHASH_HASHNAME. For example, to
access TIGER you use the PHP constant MHASH_TIGER.
&reftitle.required;
To use it, download the mhash distribution from its web site and follow the included
installation instructions.
&reference.mhash.configure;
&reftitle.runtime;
&no.config;
&reftitle.resources;
&no.resource;
&reference.mhash.constants;
&reftitle.examples;
Compute the MD5 digest and hmac and print it out as hex
\n";
$hash = mhash(MHASH_MD5, $input, "Jefe");
echo "The hmac is " . bin2hex($hash) . "
\n";
?>
]]>
This will produce:
&reference.mhash.functions;