diff options
author | Vika <vika@fireburn.ru> | 2023-07-09 01:41:25 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2023-07-09 01:41:25 +0300 |
commit | 11121d4713abf886d95451eced880848eaf098ba (patch) | |
tree | f4056a4f49454efb484266ac00907f40d8bd9f5a /kittybox-rs | |
parent | d2edc1605e41a2da9b5a1e29b3116cc24317739c (diff) | |
download | kittybox-11121d4713abf886d95451eced880848eaf098ba.tar.zst |
password-hasher: print prompts to stderr
Diffstat (limited to 'kittybox-rs')
-rw-r--r-- | kittybox-rs/examples/password-hasher.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kittybox-rs/examples/password-hasher.rs b/kittybox-rs/examples/password-hasher.rs index 2cba606..f11c591 100644 --- a/kittybox-rs/examples/password-hasher.rs +++ b/kittybox-rs/examples/password-hasher.rs @@ -3,8 +3,8 @@ use std::io::Write; use argon2::{Argon2, password_hash::{rand_core::OsRng, PasswordHasher, PasswordHash, PasswordVerifier, SaltString}}; fn main() -> std::io::Result<()> { - print!("Type a password: "); - std::io::stdout().flush().unwrap(); + eprint!("Type a password: "); + std::io::stderr().flush().unwrap(); let password = { let mut s = String::new(); std::io::stdin().read_line(&mut s)?; @@ -14,7 +14,7 @@ fn main() -> std::io::Result<()> { let salt = SaltString::generate(&mut OsRng); let argon2 = Argon2::default(); - println!("{}", password.trim()); + //eprintln!("{}", password.trim()); let password_hash = argon2.hash_password(password.trim().as_bytes(), &salt) .expect("Hashing a password should not error out") .serialize(); |