Foodtruck Order — TypeScript Reference - v0.1.0
    Preparing search index...

    Argon2id credential hashing boundary. The library owns random salts and verification.

    interface PasswordHasher {
        hash(password: string): Promise<string>;
        verify(hash: string, password: string): Promise<boolean>;
    }

    Implemented by

    Index
    • Hash a plaintext password, validating the password policy and selecting a random salt.

      Parameters

      • password: string

        Plaintext password; never trimmed, truncated, or logged.

      Returns Promise<string>

      A self-describing encoded hash suitable for storage.

      PasswordPolicyError When the password violates validatePassword.

    • Compare a plaintext password against a stored encoded hash.

      Parameters

      • hash: string

        Stored encoded hash produced by PasswordHasher.hash.

      • password: string

        Candidate plaintext password.

      Returns Promise<boolean>

      true only when the password matches the hash; never throws for a mismatch.