Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

Params

bcrypt parameters

bcrypt.Params
pub const Params = struct

File

lib/std/crypto/bcrypt.zig:409

Code

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 };
}