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)}")
}Вывод
true
pub(api) static fn hashWith(pw: str, logN: i64) -> str randСложность. time and memory grow with `2^logN`.
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
pw | str |
logN | i64 |
Возвращает
str
Эффекты
rand
Определено в: std/crypto/crypto.oxl:802