diff --git a/src/main.rs b/src/main.rs index c550654..078d3bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,12 +11,15 @@ struct Args { } fn hash(input: Vec) -> String { - let characters = "abcdefghijklmnopqrstuvwxyz".chars().collect::>(); - let numbers = "0123456789".chars().collect::>(); - let mut hash: u64 = 0; let prime: u64 = 67_280_421_310_721; + let mut rng = StdRng::seed_from_u64(prime); + + let numbers = "0123456789".chars().collect::>(); + let mut characters = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ".chars().collect::>(); + characters.shuffle(&mut rng); + for (i, c) in input.iter().enumerate() { hash = hash.wrapping_mul(prime).wrapping_add(*c as u64 + i as u64); } @@ -34,7 +37,7 @@ fn hash(input: Vec) -> String { } } - let mut rng = StdRng::seed_from_u64(hash); + rng = StdRng::seed_from_u64(hash); hash_vector.shuffle(&mut rng); hash_vector[0..64].iter().collect()