Skip to content

Password

1 min read

Import: import system.webapi.auth;

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

Password

Argon2id password hashes in the interoperable PHC format.

public static class Password

hash

Hashes password with Argon2id and returns a PHC-encoded hash, or an authentication error.

public static fun hash(password: string): Result<string, AuthError>

verify

Checks a password against its encoded hash, returning false on mismatch or an error if verification fails.

public static fun verify(password: string, hash: string): Result<bool, AuthError>