verifyPasswordHash() public method

Verify if the given $hash matches the given $password.
public verifyPasswordHash ( string $password, string $hash ) : boolean
$password string Original, un-hashed, password.
$hash string Hash string to which the check should be made
return boolean True if $password matches the $hash, otherwise false is returned.
Esempio n. 1
0
 /**
  * Verify if the $password matches the $hash.
  *
  * @param string $password
  * @param string $hash
  *
  * @return bool True if $password matches $hash. Otherwise false is returned.
  */
 public function verifyPasswordHash($password, $hash)
 {
     return $this->instance->verifyPasswordHash($password, $hash);
 }
Esempio n. 2
0
 public function testVerifyPasswordHash2()
 {
     $crypt = new Crypt();
     $password = $crypt->createPasswordHash('login123');
     $this->assertFalse($crypt->verifyPasswordHash('123login', $password));
 }