Create a hash for the given password.
public createPasswordHash ( string $password ) : string | ||
$password | string | |
return | string | Password hash. |
/** * Create a hash for the given password. * * @param string $password * * @return string Password hash. */ public function createPasswordHash($password) { return $this->encoder->createPasswordHash($password); }
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 }