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)}")
}Вывод
true false
pub(api) static fn hash(pw: str) -> str randС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
pw | str |
Возвращает
str
Эффекты
rand
Определено в: std/crypto/crypto.oxl:785