Skip to main content

verify

Function verify 

Source
pub fn verify<P: AsRef<[u8]>>(password: P, hash: &str) -> BcryptResult<bool>
Expand description

Verify password against a hash string, in constant time per candidate.

The cost and salt come from the parsed string; any of the four $2*$ prefixes is accepted, and all compute the same algorithm (see the crate-level “Variant semantics” section). Needs neither std nor alloc.

§Errors

InvalidHash if the string does not parse.