PHP Класс Neos\Flow\Security\Cryptography\BCryptHashingStrategy

Наследование: implements Neos\Flow\Security\Cryptography\PasswordHashingStrategyInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cost integer Number of rounds to use with BCrypt for hashing passwords, must be between 4 and 31

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

Метод Описание
__construct ( integer $cost ) Construct a PBKDF2 hashing strategy with the given parameters
hashPassword ( string $password, string $staticSalt = null ) : string Creates a BCrypt hash
validatePassword ( string $password, string $hashedPasswordAndSalt, string $staticSalt = null ) : boolean Validate a password against a derived key (hashed password) and salt using BCrypt

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

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

Construct a PBKDF2 hashing strategy with the given parameters
public __construct ( integer $cost )
$cost integer

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

Creates a BCrypt hash
public hashPassword ( string $password, string $staticSalt = null ) : string
$password string The plaintext password to hash
$staticSalt string Optional static salt that will not be stored in the hashed password
Результат string the result of the crypt() call

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

Passwords hashed with a different cost can be validated by using the cost parameter of the hashed password and salt.
public validatePassword ( string $password, string $hashedPasswordAndSalt, string $staticSalt = null ) : boolean
$password string The cleartext password
$hashedPasswordAndSalt string The derived key and salt in as returned by crypt() for verification
$staticSalt string Optional static salt that will be appended to the dynamic salt
Результат boolean TRUE if the given password matches the hashed password

Описание свойств

$cost защищенное свойство

Number of rounds to use with BCrypt for hashing passwords, must be between 4 and 31
protected int $cost
Результат integer