╭ user.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1 const std = @import("std"); 2 3 const bcrypt = std.crypto.pwhash.bcrypt; 4 5 pub const password_hash_max_len = bcrypt.hash_length * 2; 6 7 pub fn hashPassword( 8 password: []const u8, 9 out: []u8, 10 io: std.Io, 11 ) ![]const u8 { 12 return bcrypt.strHash(password, .{ 13 .params = bcrypt.Params.owasp, 14 .encoding = .phc, 15 }, out, io); 16 } 17