Skip to main content

non_truncating_hash_bytes

Function non_truncating_hash_bytes 

Source
pub fn non_truncating_hash_bytes<P: AsRef<[u8]>>(
    password: P,
    cost: u32,
) -> BcryptResult<[u8; 60]>
Expand description

Generates a password hash using the cost given, returning a fixed-size stack buffer. The salt is generated randomly using the OS randomness. The returned buffer is always exactly 60 bytes of valid UTF-8 (version 2b format). Will return BcryptError::Truncation if password is longer than 72 bytes