Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
PHP implementation of the RFC 2104 Hash based Message Authentication Code algorithm.
STRING = 'string'
Constants representing the output mode of the hash algorithm
Details BINARY = 'binary'
Detailsstring $_hashAlgorithm = 'md5'Hashing algorithm; can be the md5/sha1 functions or any algorithm name listed in the output of PHP 5.1.2+ hash_algos().
Detailsstring $_key = 'null'The key to use for the hash
Detailsstring $_packFormat = 'null'pack() format to be used for current hashing method
Detailsarray $_supportedMhashAlgorithms = 'array'List of algorithms supported my mhash()
Details_getMhashDefinition(
string $hashAlgorithm
)
:
integerSince MHASH accepts an integer constant representing the hash algorithm we need to make a small detour to get the correct integer matching our algorithm's name.
Details_hash(
string $data, string $output
=
self, bool $internal
=
false
)
:
stringPerform HMAC and return the keyed data
Details_setHashAlgorithm(
string $hash
)
:
Zend_Crypt_HmacSetter for the hash method.
Detailscompute(
string $key, string $hash, string $data, string $output
=
self
)
:
stringPerforms a HMAC computation given relevant details such as Key, Hashing algorithm, the data to compute MAC of, and an output format of String, Binary notation or BTWOC.
Details