Skip to content

Commit

Permalink
update gitignore and rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
trgilmore committed Sep 11, 2024
1 parent 5a19f29 commit f648792
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
target/debug/.fingerprint
target/debug/incremental
/target/
target
.github
/.idea/modules.xml
Expand Down
41 changes: 16 additions & 25 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//use std::vec;
use rand::Rng;
use figleter::FIGfont;
use rand::Rng;

fn main() {
let standard_font = FIGfont::standard().unwrap();
Expand All @@ -10,32 +10,23 @@ fn main() {
println!("Here is your password: \n\n");

fn generate_standard() -> String {
let char_bank: [char; 65] = [
'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y',
'z','A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X',
'Y', 'Z', '*', '@', '!' ];
let char_bank: [char; 66] = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '*', '@', '!', '#'
];

const FILLER: char = 'a';
const FILLER: char = 'a';

let mut pass_array: [char; 16]= [FILLER; 16];
for x in 0..16 {
let c = rand::thread_rng().gen_range(0..=64);
pass_array[x] = char_bank[c];
}
let password = String::from_iter(pass_array);
password
let mut pass_array: [char; 16] = [FILLER; 16];
for x in 0..16 {
let c = rand::thread_rng().gen_range(0..=65);
pass_array[x] = char_bank[c];
}
let password = String::from_iter(pass_array);
password
}
println!("{}\n\n",generate_standard());
println!("{}\n\n", generate_standard());
println!("Do you want to keep a record of this password? (Yes)\n1. Yes\n2. New Standard Password\n3. Quit")

}

0 comments on commit f648792

Please sign in to comment.