package passe

  1. Overview
  2. Docs

Module Passe.Argon2Source

Sourcetype error = [
  1. | `Invalid_time_cost of string
  2. | `Invalid_memory_cost of string
  3. | `Invalid_parallelism of string
  4. | `Invalid_salt_length of int
  5. | `Hash_failure of string
  6. | `Verify_mismatch
  7. | `Invalid_hash of string
]
Sourceval pp_error : Format.formatter -> error -> unit

pp_error fmt err pretty print bcrypt error err to formatter fmt

Sourcetype params = {
  1. t_cost : int;
  2. m_cost : int;
  3. parallelism : int;
}
Sourceval default_params : params

default parameters following OWASP recommendations

Sourceval hash_with_salt : salt:string -> params:params -> string -> (hash, error) result

hash_with_salt ~salt ~params password hash the password using the given salt and params

Sourceval hash : ?params:params -> string -> (hash, error) result

hash ?params password hash the password using the given params. If no params is provided, default params are used.

Sourceval verify : hash:hash -> string -> (bool, error) result

verify ~hash password verify that the password matches the given hash