test the hash function

master
rasul 4 years ago
parent 81c1c2920c
commit 77ab912d19

@ -52,3 +52,17 @@ pub fn salt() -> String {
salt salt
} }
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_hash() {
let password = "butterflies";
let salt = "cucumbers";
let hashed = hash(password, salt).unwrap();
assert_eq!(hashed, "$argon2i$v=19$m=4096,t=3,p=1$Y3VjdW1iZXJz$r5IYZSVjTOQoW9bGSv3GseB6pcOSEK8btQ8ftJX5wmE");
}
}

Loading…
Cancel
Save