Function botan::bcrypt_verify

source ·
pub fn bcrypt_verify(pass: &str, hash: &str) -> Result<bool>
Expand description

Verify a bcrypt password hash

Examples

let mut rng = botan::RandomNumberGenerator::new().unwrap();
let bcrypt = botan::bcrypt_hash("password", &mut rng, 10).unwrap();
assert_eq!(botan::bcrypt_verify("not even close", &bcrypt), Ok(false));
assert_eq!(botan::bcrypt_verify("password", &bcrypt), Ok(true));