createPasswordHash() public méthode

Create a hash for the given password.
public createPasswordHash ( string $password ) : string
$password string
Résultat string Password hash.
Exemple #1
0
 /**
  * Create a hash for the given password.
  *
  * @param string $password
  *
  * @return string Password hash.
  */
 public function createPasswordHash($password)
 {
     return $this->encoder->createPasswordHash($password);
 }
Exemple #2
0
 public function testCreatePasswordHash()
 {
     $encoder = new Encoder('\\Webiny\\Component\\Security\\Tests\\Mocks\\EncoderMock');
     $this->assertSame('password', $encoder->createPasswordHash('password'));
     // since we use the mock encoder, there is no hashing
 }