[][src]Function argon2::hash_raw_std

pub fn hash_raw_std(
    variant: Variant,
    version: Version,
    mem_cost: u32,
    time_cost: u32,
    parallelism: u32,
    pwd: &[u8],
    salt: &[u8],
    hash_len: u32
) -> Result<Vec<u8>>
Deprecated since 0.2.0:

please use hash_raw instead

Hashes the password and returns the hash as a vector (standard).

Examples

use argon2::{self, Variant, Version};

let pwd = b"password";
let salt = b"somesalt";
let mem_cost = 4096;
let time_cost = 10;
let parallelism = 1;
let hash_len = 32;
let vec = argon2::hash_raw_std(Variant::Argon2i,
                               Version::Version13,
                               mem_cost,
                               time_cost,
                               parallelism,
                               pwd,
                               salt,
                               hash_len).unwrap();

The above rewritten using hash_raw:

use argon2::{self, Config, ThreadMode, Variant, Version};

let pwd = b"password";
let salt = b"somesalt";
let config = Config {
    variant: Variant::Argon2i,
    version: Version::Version13,
    mem_cost: 4096,
    time_cost: 10,
    lanes: 1,
    thread_mode: ThreadMode::Sequential,
    secret: &[],
    ad: &[],
    hash_length: 32,
};
let vec = argon2::hash_raw(pwd, salt, &config);