ihmac() public static method

This class always performs at least one hash to prevent the input from being passed back unchanged if bad parameters are set.
public static ihmac ( string $data, string $key, integer $iter, string $algo = 'sha256' ) : string
$data string Data to hash.
$key string Key to use to authenticate the hash.
$iter integer Number of times to iteratate the hash
$algo string Name of algo (sha256 or sha512 recommended)
return string
Beispiel #1
0
 public function testIhmacSanity()
 {
     // Make sure at least one hash always happens with any kind of crazy cost value
     $this->assertNotEquals('aaaa', Hash::ihmac('aaaa', 'bbbb', 0));
     $this->assertNotEquals('aaaa', Hash::ihmac('aaaa', 'bbbb', -1));
 }