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:
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 randComplexity. time and memory grow with `2^logN`.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
pw | str |
logN | i64 |
Returns
str
Effects
rand
Defined in: std/crypto/crypto.oxl:802