pub fn hash_password(
password: &[u8],
salt: &[u8],
params: &Params,
) -> Result<String, Argon2Error>Expand description
Hash a password and return the PHC-encoded string.
§Example
ⓘ
use crypto::argon2::{hash_password, verify_password, Params};
let encoded = hash_password(
b"correct horse battery staple",
b"randomsalt123456",
&Params { iterations: 3, memory: 65536, parallelism: 4, tag_length: 32 },
).unwrap();
assert!(verify_password(b"correct horse battery staple", &encoded).is_ok());
assert!(verify_password(b"wrong password", &encoded).is_err());