[][src]Function argon2::hash

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>

Generic Argon2 hash function.

Parameters

  • t_cost: Number of iterations
  • m_cost: Sets memory usage to m_cost kibibytes
  • parallelism: Number of threads and compute lanes
  • pwd: 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.