struct Params [src]
bcrypt parameters
Fields
rounds_log: u6log2 of the number of rounds
silently_truncate_password: boolAs originally defined, bcrypt silently truncates passwords to 72 bytes.
In order to overcome this limitation, if silently_truncate_password is set to false,
long passwords will be automatically pre-hashed using HMAC-SHA512 before being passed to bcrypt.
Only set silently_truncate_password to true for compatibility with traditional bcrypt implementations,
or if you want to handle the truncation yourself.
Members
- owasp (Constant)
Source
pub const Params = struct {
const Self = @This();
/// log2 of the number of rounds
rounds_log: u6,
/// As originally defined, bcrypt silently truncates passwords to 72 bytes.
/// In order to overcome this limitation, if `silently_truncate_password` is set to `false`,
/// long passwords will be automatically pre-hashed using HMAC-SHA512 before being passed to bcrypt.
/// Only set `silently_truncate_password` to `true` for compatibility with traditional bcrypt implementations,
/// or if you want to handle the truncation yourself.
silently_truncate_password: bool,
/// Minimum recommended parameters according to the
/// [OWASP cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html).
pub const owasp = Self{ .rounds_log = 10, .silently_truncate_password = false };
}