PHP Класс Webiny\Component\Security\Encoder\Encoder

This class loads the defined encoder and uses it to create a hash from the submitted password and verifies if it matches the password from the user provider.
Наследование: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\FactoryLoaderTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $driver, array | null $params = null )
createPasswordHash ( string $password ) : string Create a hash for the given password.
verifyPasswordHash ( string $password, string $hash ) : boolean Verify if the $password matches the $hash.

Описание методов

__construct() публичный Метод

public __construct ( string $driver, array | null $params = null )
$driver string Name of the encoder provider class.
$params array | null Optional encoder params.

createPasswordHash() публичный Метод

Create a hash for the given password.
public createPasswordHash ( string $password ) : string
$password string
Результат string Password hash.

verifyPasswordHash() публичный Метод

Verify if the $password matches the $hash.
public verifyPasswordHash ( string $password, string $hash ) : boolean
$password string
$hash string
Результат boolean True if $password matches $hash. Otherwise false is returned.