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