Fix bcrypt password hash for demo user + add test generator

This commit is contained in:
Warren
2026-06-30 08:25:40 +08:00
parent b9bea0db23
commit e45cb96d07
2 changed files with 11 additions and 0 deletions
+11
View File
@@ -261,3 +261,14 @@ mod tests {
assert!(dir.is_some());
}
}
#[test]
fn test_bcrypt_hash() {
let password = "demo123";
let hash = bcrypt::hash(password, bcrypt::DEFAULT_COST).unwrap();
println!("Hash for demo123: {}", hash);
// Verify the hash works
let valid = bcrypt::verify(password, &hash).unwrap();
assert!(valid);
}