Function argon2::encoded_len

source ·
pub fn encoded_len(
    variant: Variant,
    mem_cost: u32,
    time_cost: u32,
    parallelism: u32,
    salt_len: u32,
    hash_len: u32
) -> u32
Expand description

Returns the length of the encoded string.

Remarks

The length is one less that the original C version, since no null terminator is used.

Examples

use argon2::{self, Variant};

let variant = Variant::Argon2i;
let mem = 4096;
let time = 10;
let parallelism = 10;
let salt_len = 8;
let hash_len = 32;
let enc_len = argon2::encoded_len(variant, mem, time, parallelism, salt_len, hash_len);
assert_eq!(enc_len, 86);