feat: add pwhash
This commit is contained in:
11
pwhash/src/main.rs
Normal file
11
pwhash/src/main.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use pwhash::bcrypt;
|
||||
|
||||
fn main() {
|
||||
// Hash a password with default parameters.
|
||||
let h_new = bcrypt::hash("password").unwrap();
|
||||
|
||||
// Verify a password against an existing hash.
|
||||
let h = "$2y$05$bvIG6Nmid91Mu9RcmmWZfO\
|
||||
5HJIMCT8riNW0hEp8f6/FuA2/mHZFpe";
|
||||
assert!(bcrypt::verify("password", h));
|
||||
}
|
||||
Reference in New Issue
Block a user