check() public method

{@inheritDoc}
public check ( $value, $hashedValue )
Exemplo n.º 1
0
 public function testSymbolsValue()
 {
     // Never use this hashing strategy!
     $hash = function ($value) {
         return strrev($value);
     };
     $check = function ($value, $hashedValue) {
         return strrev($value) === $hashedValue;
     };
     $hasher = new CallbackHasher($hash, $check);
     $hashedValue = $hasher->hash('!"#$%^&*()-_,./:;<=>?@[]{}`~|');
     $this->assertTrue($hashedValue !== '!"#$%^&*()-_,./:;<=>?@[]{}`~|');
     $this->assertTrue($hasher->check('!"#$%^&*()-_,./:;<=>?@[]{}`~|', $hashedValue));
 }