Exemplo n.º 1
0
 public function check($password, $hash, $salt = NULL, $iterations = NULL)
 {
     // $2a$ (4) 00 (2) $ (1) <salt> (22)
     preg_match('/^\\$2a\\$(\\d{2})\\$(.{22})/D', $hash, $matches);
     // Extract the iterations and salt from the hash
     list($_, $iterations, $salt) = $matches;
     return parent::check($password, $hash, $salt, $iterations);
 }
Exemplo n.º 2
0
 public function hash($password, $salt = NULL, $iterations = NULL)
 {
     if ($salt === NULL) {
         // Legacy auth uses FALSE for no salt
         $salt = FALSE;
     }
     // Hash the password, only one iteration supported
     return parent::hash($password, $salt, 1);
 }