PHP implementation of the RFC 2104 Hash based Message Authentication Code

 Methods

Clear the cache of last algorithm supported

clearLastAlgorithmCache() 

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, bool $output) : string

Parameters

$key

string

$hash

string

$data

string

$output

bool

Exceptions

\Zend\Crypt\Exception\InvalidArgumentException

Returns

string

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

getOutputSize(string $hash, bool $output) : int

Parameters

$hash

string

$output

bool

Returns

int

Get the supported algorithm

getSupportedAlgorithms() : array

Returns

array

Is the hash algorithm supported?

isSupported(string $algorithm) : bool

Parameters

$algorithm

string

Returns

bool

 Properties

 

Last algorithm supported

$lastAlgorithmSupported : string | null

 Constants

 

OUTPUT_BINARY

OUTPUT_BINARY 

 

OUTPUT_STRING

OUTPUT_STRING