Files
simple-rust-tests/__crypto/pwhash/src/main.rs
2020-10-17 11:47:07 +08:00

12 lines
317 B
Rust

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));
}