sha256_crypt

Function sha256_crypt 

Source
pub fn sha256_crypt(
    password: &[u8],
    salt: &[u8],
    params: &Sha256Params,
) -> Result<[u8; 32], CryptError>
Expand description

The SHA256 crypt function returned as byte vector

If the provided hash is longer than defs::SALT_MAX_LEN character, it will be stripped down to defs::SALT_MAX_LEN characters.

§Arguments

  • password - The password to process as a byte vector
  • salt - The salt value to use as a byte vector
  • params - The Sha256Params to use WARNING: Make sure to compare this value in constant time!

§Returns

  • Ok(()) if calculation was successful
  • Err(errors::CryptError) otherwise