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

Function hash_password

ch_11/src/routes/authentication.rs:51–57  ·  view source on GitHub ↗
(password: &[u8])

Source from the content-addressed store, hash-verified

49}
50
51fn hash_password(password: &[u8]) -> String {
52 let salt = SaltString::generate(&mut OsRng);
53 Argon2::default()
54 .hash_password(password, &salt)
55 .expect("Failed to hash password")
56 .to_string()
57}
58
59fn verify_password(
60 hash: &str,

Callers 1

registerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected