Phalcon\Test\Proxy\Security::checkHash PHP Method

checkHash() public method

public checkHash ( $password, $passwordHash, $maxPassLength )
    public function checkHash($password, $passwordHash, $maxPassLength = 0)
    {
        return parent::checkHash($password, $passwordHash, $maxPassLength);
    }

Usage Example

示例#1
0
 /**
  * Tests Security::hash
  */
 public function testHash()
 {
     $this->specify('The Security::hash works incorrectly', function () {
         $s = new Security();
         $password = '******';
         $s->setDefaultHash(Security::CRYPT_DEFAULT);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_STD_DES);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_EXT_DES);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_BLOWFISH);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_BLOWFISH_A);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_BLOWFISH_X);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_BLOWFISH_Y);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_SHA256);
         expect($s->checkHash($password, $s->hash($password)))->true();
         $s->setDefaultHash(Security::CRYPT_SHA512);
         expect($s->checkHash($password, $s->hash($password)))->true();
     });
 }