This commit is contained in:
2025-08-20 00:42:01 +08:00
commit 06bb5439b4
73 changed files with 30196 additions and 0 deletions

9
src/utils/password.rs Normal file
View 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)
}