Pop\Crypt\Md5::verify PHP Method

verify() public method

Method to verify the hashed value
public verify ( string $string, string $hash ) : boolean
$string string
$hash string
return boolean
    public function verify($string, $hash)
    {
        $result = crypt($string, $hash);
        return $result === $hash;
    }

Usage Example

Beispiel #1
0
 public function testMd5()
 {
     $crypt = new Crypt\Md5();
     $crypt->setSalt('Test Salt');
     $this->assertEquals('Test Salt', $crypt->getSalt());
     $hash = $crypt->create('12password34');
     $this->assertTrue($crypt->verify('12password34', $hash));
 }
All Usage Examples Of Pop\Crypt\Md5::verify