def pbkdf2
import bend-kit-postgres@0.3.0.0/scram.bend as Scramimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
167# SaltedPassword = Hi(pass, salt, iters) (RFC 5802 §2.2), which is PBKDF2 with HMAC-SHA-256.
168def pbkdf2(+pass: String, +salt: String, +iters: U32) -> IO(Result<&1, &1, U32 & String, String>):
169 do IO<Result<&1, &1, U32 & String, String>>:
170 r : Result<&1, &1, U32 & String, U32 & Array<U32>> <- pbkdf2.of(Bytes.from_string(pass), Bytes.from_string(salt), iters)
171 return octets(r)