aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2022-03-25 22:56:50 +0100
committergabrielgio <gabriel.giovanini@pm.me>2022-03-25 22:56:50 +0100
commitb7c2d331b264605643fb2b11b1b75096558dbfdb (patch)
treef6d5805d41a455637acd66ce224703f12c04a68a
parent860594ffb7c013e5f4257bd615472e08c8c685c6 (diff)
downloadgenpass-b7c2d331b264605643fb2b11b1b75096558dbfdb.tar.gz
genpass-b7c2d331b264605643fb2b11b1b75096558dbfdb.tar.bz2
genpass-b7c2d331b264605643fb2b11b1b75096558dbfdb.zip
fix: Extend special char
Add missing special ASCII chars.
-rw-r--r--src/lib.rs2
-rw-r--r--tests/web.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a19cbfa..e8999d4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,7 +24,7 @@ pub fn generate(len: usize, lower: bool, upper: bool, number: bool, special: boo
let mut upper_charset: Vec<char> = String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZ").chars().collect();
let mut lower_charset: Vec<char> = String::from("abcdefghijklmnopqrstuvwxyz").chars().collect();
let mut number_charset: Vec<char> = String::from("1234567890").chars().collect();
- let mut special_charset: Vec<char> = String::from("!@#$%^&*()+{}[]").chars().collect();
+ let mut special_charset: Vec<char> = String::from("!@#$%^&*()+{}[]><:|+=;-.,'?_~\\/`\"").chars().collect();
let mut result: Vec<char> = Vec::new();
let mut rng = rand::thread_rng();
diff --git a/tests/web.rs b/tests/web.rs
index b83608f..eedd1b4 100644
--- a/tests/web.rs
+++ b/tests/web.rs
@@ -54,7 +54,7 @@ fn generate_not_number_letters() {
#[wasm_bindgen_test]
fn generate_not_special_letters() {
- let upper_charset = "!@#$%^&*()+{}[]";
+ let upper_charset = "!@#$%^&*()+{}[]><:|+=;-.,'?_~\\/`\"";
for x in 0..ATTEMPTS {
let password = generate(x, true, true, true, false);
for char in String::from(upper_charset).chars().into_iter() {