OxL Справочник OxL
РусскийEnglish

method password.hash

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

Example:

oxl✓ проверяется в CI
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

Параметры

ИмяТип
pwstr

Возвращает

str

Эффекты

rand

Определено в: std/crypto/crypto.oxl:785

См. также