OxL Reference

method password.hash

Hashes a password with scrypt; the result carries the salt and the cost, so verify needs only the text.

Example:

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

fn main() io, rand {
  let h = password.hashWith("secret", 10)
  print("{password.verify("secret", h)} {password.verify("other", h)}")
}
Output
true false
pub(api) static fn hash(pw: str) -> str  rand

Since. 1.0.0-beta

Parameters

NameType
pwstr

Returns

str

Effects

rand

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

See also