Cartalyst\Sentinel\Hashing\WhirlpoolHasher::check PHP Method

check() public method

{@inheritDoc}
public check ( $value, $hashedValue )
    public function check($value, $hashedValue)
    {
        $salt = substr($hashedValue, 0, $this->saltLength);
        return $this->slowEquals($salt . hash('whirlpool', $salt . $value), $hashedValue);
    }

Usage Example

Ejemplo n.º 1
0
 public function testSymbolsValue()
 {
     $hasher = new WhirlpoolHasher();
     $hashedValue = $hasher->hash('!"#$%^&*()-_,./:;<=>?@[]{}`~|');
     $this->assertTrue($hashedValue !== '!"#$%^&*()-_,./:;<=>?@[]{}`~|');
     $this->assertTrue($hasher->check('!"#$%^&*()-_,./:;<=>?@[]{}`~|', $hashedValue));
 }
WhirlpoolHasher