Function encrypt_with_params

Source
pub fn encrypt_with_params(
    plaintext: &[u8],
    passphrase: &[u8],
    memory_cost: u32,
    time_cost: u32,
    parallelism: u32,
) -> Result<Vec<u8>, JsError>
Expand description

Encrypts plaintext with the specified Argon2 parameters and into a newly allocated Uint8Array.

This uses Argon2id as the Argon2 type and version 0x13 as the Argon2 version.

ยงErrors

Returns an error if any of the following are true:

  • The Argon2 parameters are invalid.
  • The Argon2 context is invalid.