Свойство | Тип | Описание | |
---|---|---|---|
$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 |
public __construct ( integer $cost ) | ||
$cost | integer |
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 |
protected int $cost | ||
Результат | integer |