MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / hash_password

Function hash_password

ch_09/src/routes/authentication.rs:67–73  ·  view source on GitHub ↗
(password: &[u8])

Source from the content-addressed store, hash-verified

65}
66
67fn hash_password(password: &[u8]) -> String {
68 let salt = SaltString::generate(&mut OsRng);
69 Argon2::default()
70 .hash_password(password, &salt)
71 .expect("Failed to hash password")
72 .to_string()
73}
74
75fn verify_password(
76 hash: &str,

Callers 1

registerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected