generateSalt() protected method
Generates a salt that can be used to generate a password hash.
The PHP crypt() built-in function requires, for the Blowfish hash algorithm, a salt string in a specific format: "$2a$", "$2x$" or "$2y$", a two digit cost parameter, "$", and 22 characters from the alphabet "./0-9A-Za-z".
protected string generateSalt ( $cost = 13 ) | ||
---|---|---|
$cost | integer |
The cost parameter |
return | string |
The random salt value. |
throws | yii\base\InvalidParamException |
if the cost parameter is out of the range of 4 to 31. |
Please login to continue.