def hash_password

bend-collections@1.0.0.0 · src/crypto/password.bend:43

import bend-collections@1.0.0.0/src/crypto/password.bend as Password
import Base
import bend-collections@1.0.0.0/src/crypto/argon2/argon2.bend as A2

43# The PHC string of Argon2id(pw, salt) with the parameters, or None when they
44# are out of the RFC 9106 ranges (or m > 2^23 KiB, this implementation's limit).
45def hash_password(+pw: List<&2, U32>, +salt: List<&2, U32>, params: Params) -> Maybe<&2, String>:
46  match params:
47    case Params{+m, +t, +p, +tag, s}:
48      encode(m, t, p, salt, A2.argon2id(pw, salt, Nil{}, Nil{}, t, m, p, tag))

Uses (7)

Used by (1)