[][src]Function sodiumoxide::crypto::pwhash::scryptsalsa208sha256::pwhash

pub fn pwhash(
    passwd: &[u8],
    OpsLimit: OpsLimit,
    MemLimit: MemLimit
) -> Result<HashedPassword, ()>

The pwhash() returns a HashedPassword which includes:

  • the result of a memory-hard, CPU-intensive hash function applied to the password passwd
  • the automatically generated salt used for the previous computation
  • the other parameters required to verify the password: opslimit and memlimit

OPSLIMIT_INTERACTIVE and MEMLIMIT_INTERACTIVE are safe baseline values to use for opslimit and memlimit.

The function returns Ok(hashed_password) on success and Err(()) if it didn't complete successfully