Expand description

Functions for creating hashed passwords with salt using argon2

Create a hashed password with salt

let (hash, salt) = argon_hash_password::create_hash_and_salt("PlaintextPassword").unwrap();

The hash and salt can then be stored

Check a Hash

let check = argon_hash_password::check_password_matches_hash("PlaintextPassword", hash, salt).unwrap();
match check {
    true => println!("Correct plaintext password provided"),
    false => println!("Incorrect plaintext password provided"),
}

Functions

Check that password and salt matches generated hash
Given a plaintext password return a password hash and a generated salt
Generate a secure 128-bit session ID of alphanumeric characters
Given a plaintext password and a SaltString, return the hash of the password
Verify that the password matches a certain length and the confirmation password provided