From 406b2766685e6b6b602c75c64ac971713b2b63c7 Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Mon, 9 Sep 2024 14:46:50 +0100 Subject: [PATCH] feat: test file to generate password and it hash --- src/defaults.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/defaults.rs b/src/defaults.rs index 72a57605..3d311de3 100644 --- a/src/defaults.rs +++ b/src/defaults.rs @@ -324,3 +324,16 @@ pub fn env_no_empty(varname: &str) -> Option { None => None, } } + +#[cfg(test)] +mod tests { + + #[test] + fn create_password_and_password_hash() { + let password = crate::secrets::hex_secret_32(); + println!("Logging Password: {}", password); + let hashed_password = + bcrypt::hash(&password, bcrypt::DEFAULT_COST).expect("failed to bcrypt"); + println!("Hashed Password: {}", hashed_password); + } +}