Compute a hash of a password using the scrypt key derivation function. The function returns a string that includes all the parameters required for verification.
pub fn strHash(
password: []const u8,
options: HashOptions,
out: []u8,
io: std.Io,
) Error![]const u8
pub fn strHash(
password: []const u8,
options: HashOptions,
out: []u8,
io: std.Io,
) Error![]const u8 {
const allocator = options.allocator orelse return Error.AllocatorRequired;
switch (options.encoding) {
.phc => return PhcFormatHasher.create(allocator, password, options.params, out, io),
.crypt => return CryptFormatHasher.create(allocator, password, options.params, out, io),
}
}