init
This commit is contained in:
9
src/utils/password.rs
Normal file
9
src/utils/password.rs
Normal file
@ -0,0 +1,9 @@
|
||||
use bcrypt::{hash, verify, DEFAULT_COST};
|
||||
|
||||
pub fn hash_password(password: &str) -> Result<String, bcrypt::BcryptError> {
|
||||
hash(password, DEFAULT_COST)
|
||||
}
|
||||
|
||||
pub fn verify_password(password: &str, hash: &str) -> Result<bool, bcrypt::BcryptError> {
|
||||
verify(password, hash)
|
||||
}
|
||||
Reference in New Issue
Block a user