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.

strVerify

Verify that a previously computed hash is valid for a given password.

scrypt.strVerify
pub fn strVerify(
    str: []const u8,
    password: []const u8,
    options: VerifyOptions,
) Error!void

File

lib/std/crypto/scrypt.zig:574

Code

pub fn strVerify(
    str: []const u8,
    password: []const u8,
    options: VerifyOptions,
) Error!void {
    if (mem.startsWith(u8, str, crypt_format.prefix)) {
        return CryptFormatHasher.verify(options.allocator, str, password);
    } else {
        return PhcFormatHasher.verify(options.allocator, str, password);
    }
}