crypto.password.argon2

Functions for encrypting passwords using the recommended argon2 algorithm.

See: https://github.com/P-H-C/phc-winner-argon2

check

(check raw hash)

Compare a raw string with a string encrypted with the encrypt function. Returns true if the string matches, false otherwise.

encrypt

(encrypt raw)(encrypt raw t)(encrypt raw t m)(encrypt raw t m p)

Encrypt a password string using the argon2 algorithm. This function takes three optional parameters:

  • t - the number of iterations, defaults to 2
  • m - the memory cost, defaults to 65536
  • p - the parallelization parameter, defaults to 1