7 stable releases

1.3.0 Sep 23, 2024
1.2.0 Sep 23, 2024
1.1.1 Sep 23, 2024
1.0.3 Sep 23, 2024

#1367 in Cryptography

Download history 38/week @ 2024-09-29 12/week @ 2024-10-06 11/week @ 2024-10-13 1/week @ 2024-10-20 4/week @ 2024-10-27 1/week @ 2024-11-17 2/week @ 2024-12-08

86 downloads per month

MIT license

6KB
80 lines

hashed_password

A rust library to handle password storage.

Usage

First, create a HashedPassword:

use hashed_password::HashedPassword;

let hashed = HashedPassword::from_plain("MyPlainPassword", b"my-secret");
println!("hashed data: {}", hashed.as_str());

Then, validate any plain:

hashed.validate("MyPlainPassword", b"my-secret"); // true
hashed.validate("MyPlainPassword", b"wrong-secret"); // false
hashed.validate("WrongPlainPassword", b"my-secret"); // false

features

  • serde: enable serde
  • sqlx: enable sqlx and derive sqlx::FromRow

Dependencies

~0.6–2MB
~35K SLoC