-
-
Save bonega/b69fe306638bb8ae3e72225aa65851a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
mod xorshift; | |
mod password; | |
fn main() { | |
let length = loop { | |
let mut length_buffer = String::new(); | |
println!("Enter the length of wannabe password: "); | |
io::stdin() | |
.read_line(&mut length_buffer) | |
.expect("Failed to read the line"); | |
match length_buffer.trim().parse() { | |
Ok(n) => { | |
break n; | |
} | |
Err(..) => { | |
println!("Not a valid integer!"); | |
} | |
} | |
}; | |
println!("Enter the characters you want to exclude: "); | |
let mut exclude = String::new(); | |
io::stdin() | |
.read_line(&mut exclude) | |
.expect("Failed to read the line"); | |
let excluded: Vec<_> = exclude.chars().collect(); | |
println!("{}", password::rand_pass(length, &excluded)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment