Module Argon2

Ocaml bindings to Argon2.

module ErrorCodes : sig ... end
module type HashFunctions = sig ... end
module I : HashFunctions

Bindings to Argon2i.

module D : HashFunctions

Bindings to Argon2d.

module ID : HashFunctions

Bindings to Argon2id.

type hash = string
type encoded = string
type kind =
  1. | D
  2. | I
  3. | ID
val show_kind : [ `Upper | `Lower ] -> kind -> string
type version =
  1. | VERSION_10
  2. | VERSION_13
  3. | VERSION_NUMBER
    (*

    Currently an alias for VERSION_13

    *)
val hash : t_cost:int -> m_cost:int -> parallelism:int -> pwd:string -> salt:string -> kind:kind -> hash_len:int -> encoded_len:int -> version:version -> (hash * encoded, ErrorCodes.t) Result.result

Generic function underlying the above ones.

val verify : encoded:encoded -> pwd:string -> kind:kind -> (bool, ErrorCodes.t) Result.result

Verifies a password against an encoded string.

val encoded_len : t_cost:int -> m_cost:int -> parallelism:int -> salt_len:int -> hash_len:int -> kind:kind -> int

Returns the encoded hash length for the given input parameters.