PHP implementation of the RFC 2104 Hash based Message Authentication Code

package Default

 Methods

Clear the cache of last algorithm supported

clearLastAlgorithmCache() 
Static

Performs a HMAC computation given relevant details such as Key, Hashing algorithm, the data to compute MAC of, and an output format of String, or Binary.

compute(string $key, string $hash, string $data, boolean $output = self::OUTPUT_STRING) : string
Static

Parameters

$key

string

$hash

string

$data

string

$output

boolean

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

string

Get the output size according to the hash algorithm and the output format

getOutputSize(string $hash, boolean $output = self::OUTPUT_STRING) : integer
Static

Parameters

$hash

string

$output

boolean

Returns

integer

Get the supported algorithm

getSupportedAlgorithms() : array
Static

Returns

array

Is the hash algorithm supported?

isSupported(string $algorithm) : boolean
Static

Parameters

$algorithm

string

Returns

boolean

 Properties

 

Last algorithm supported

$lastAlgorithmSupported : string | null

Default

Static

 Constants

 

OUTPUT_BINARY

OUTPUT_BINARY = true 
 

OUTPUT_STRING

OUTPUT_STRING = false