method password.hash
Hashes a password with scrypt; the result carries the salt and the cost, so verify needs only the text.
Example:
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 randSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
pw | str |
Returns
str
Effects
rand
Defined in: std/crypto/crypto.oxl:785