Module NesHashedSecretUnix

Hashed secret

High-level utilities to manipulate hashed values safely, eg. tokens or passwords.

include module type of Nes.HashedSecret

Hashed secret

High-level utilities to manipulate hashed secrets safely. This can be used for passwords and tokens, for instance.

Abstract type of a hashed secret.

val equal : t -> t -> Ppx_deriving_runtime.bool
val compare : t -> t -> Ppx_deriving_runtime.int
val pp : Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
val to_yojson : t -> Yojson.Safe.t
val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or

Utilities

val make : clear:string -> t

Make a password from a clear text. This function will generate a salt randomly, and, as such, is not deterministic.

val is : clear:string -> t -> bool

Compare a clear text and a hashed password.