OxL Reference

method password.hashWith

logN is the base-2 logarithm of the scrypt cost N (memory is 128 * N * 8 bytes); 10 is for tests only.

Example:

oxl✓ checked in CI
use std.crypto { password }

fn main() io, rand {
  let stored = password.hashWith("pw", 10)
  print("{password.verify("pw", stored)}")
}
Output
true
pub(api) static fn hashWith(pw: str, logN: i64) -> str  rand

Complexity. time and memory grow with `2^logN`.

Since. 1.0.0-beta

Parameters

NameType
pwstr
logNi64

Returns

str

Effects

rand

Defined in: std/crypto/crypto.oxl:802

See also