createPasswordHash() public method

Create a hash for the given password.
public createPasswordHash ( string $password ) : string
$password string
return string Password hash.
示例#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);
 }
示例#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
 }