#password-hashing #argon2 #helper #requirements #hash #salt #function

argon_hash_password

Helper functions for common argon2 password hashing requirements

3 releases

0.1.2 Jan 21, 2023
0.1.1 Jan 21, 2023
0.1.0 Dec 22, 2022

#15 in #salt

Download history 2/week @ 2024-11-13 8/week @ 2024-11-20 4/week @ 2024-11-27 8/week @ 2024-12-04 17/week @ 2024-12-11 1/week @ 2024-12-18 2/week @ 2025-01-08 20/week @ 2025-01-15 5/week @ 2025-01-29 13/week @ 2025-02-05 72/week @ 2025-02-12 12/week @ 2025-02-19 41/week @ 2025-02-26

139 downloads per month
Used in 2 crates

Custom license

7KB
99 lines

Argon Hash Password

Helper functions for common argon2 password hashing requirements

Create a hashed password with salt

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

The hash and salt can then be stored

Check a Hash

let check = argon_hash_password::check_password_matches("PlaintextPassword", hash, salt);

match check {
  true => println!("Correct plaintext password provided"),
  false => println!("Incorrect plaintext password provided"),
}

lib.rs:

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"),
}

Dependencies

~1–1.4MB
~30K SLoC