pub fn hash(
t_cost: u32,
m_cost: u32,
parallelism: u32,
pwd: Option<&[u8]>,
salt: Option<&[u8]>,
hash: Option<&mut [u8]>,
encoded: Option<&mut [u8]>,
variant: Variant,
version: Version,
) -> Result<(), Error>
Expand description
Generic Argon2 hash function.
§Parameters
t_cost
: Number of iterationsm_cost
: Sets memory usage to m_cost kibibytesparallelism
: Number of threads and compute lanespwd
: Slice containing the password.salt
: Slice containing the salt.hash
: Buffer where to write the raw hash.encoded
: Buffer where to write the encoded hash (as a string).variant
: The variant (type) of Argon2 to use.version
: The version of the Argon2 algorithm to use.
§Notes
- The different parallelism levels will give different results.