hashed_password

Crates.iohashed_password
lib.rshashed_password
version1.3.0
sourcesrc
created_at2024-09-23 14:35:12.953198
updated_at2024-09-23 15:51:06.004734
descriptionPassword hasher
homepage
repositoryhttps://github.com/caojen/password_hasher
max_upload_size
id1384168
size5,183
(caojen)

documentation

README

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
Commit count: 15

cargo fmt