bcryptSalt function
String
bcryptSalt({
- int? nb,
- BcryptVersion version = BcryptVersion.$2b,
- BcryptSecurity security = BcryptSecurity.good,
Generate the encoded salt to be used by the Bcrypt algorithm.
Parameters:
nb
: Number of rounds in terms of power of 2. 0 <nb
< 31version
: The BcryptVersion to use. Default BcryptVersion.$2bsecurity
: The default parameter source fornb
if not provided (default is BcryptSecurity.good).
Implementation
String bcryptSalt({
int? nb,
BcryptVersion version = BcryptVersion.$2b,
BcryptSecurity security = BcryptSecurity.good,
}) =>
BcryptContext(
version: version,
cost: nb ?? security.nb,
).toEncoded();