11 lines
269 B
Rust
11 lines
269 B
Rust
use bcryp::{hash, verify, DEFAULT_COST};
|
|
|
|
pub fn bcrypt_hash(password: &str) -> Result<String, BcryptError> {
|
|
hash(password, 5)
|
|
}
|
|
|
|
pub fn bcrypt_verify(password: &str, hashed_password: &str) -> Result<String, BcryptError> {
|
|
verify(password, hashed_password)
|
|
}
|
|
|