예제 #1
0
 /**
  * @dataProvider provideTestCreate
  */
 public function testCreateThenVerify($algo)
 {
     $factory = new Factory();
     $text = $factory->createHash('foo', $algo);
     $this->assertTrue($factory->verifyHash('foo', $text));
 }
예제 #2
0
 /**
  * Create a password hash from the supplied password and generator prefix
  *
  * @param string $password The password to hash
  * @param string $prefix   The prefix of the hashing function
  *
  * @return string The generated password hash
  */
 public function createPasswordHash($password, $prefix = '$2a$')
 {
     $factory = new PasswordFactory();
     return $factory->createHash($password, $prefix);
 }