Skip to main content

verify_many

Function verify_many 

Source
pub fn verify_many(
    passwords: &[&[u8]],
    hashes: &[&str],
) -> Vec<BcryptResult<bool>> ⓘ
Expand description

Verify a batch of password/hash-string pairs, one BcryptResult per input position.

Per-item failures stay per-item: a malformed hash string yields InvalidHash at its position while the rest of the batch verifies normally. A passwords slice shorter than hashes yields BatchLengthMismatch at the missing positions (its salts field carries hashes.len() here).

Surviving items are grouped by cost — a linear scan over a Vec<(u32, …)>: costs are 4..=31, so at most 28 groups exist and a map would buy nothing — and each group runs through the SIMD chunk loop, so mixed-cost batches work in one call. Every verdict uses the same constant-time compare as verify.