Use string library instead of monolithic arrays

up max length to 25
This commit is contained in:
amcmanu3 2023-11-13 16:02:50 -05:00
parent 91e62c647e
commit 623d6f5855

View File

@ -365,84 +365,16 @@ class Helpers:
def create_pass(self):
# maximum length of password needed
# this can be changed to suit your password length
max_len = 12
max_len = 25
# declare arrays of the character that we need in out password
# Represented as chars to enable easy string concatenation
digits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
locase = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
]
digits = string.digits
locase = string.ascii_lowercase
upcase = [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
]
upcase = string.ascii_uppercase
symbols = [
"@",
"#",
"$",
"%",
"=",
":",
"?",
".",
"/",
"|",
"~",
"*",
"(",
")",
]
symbols = string.punctuation
# combines all the character arrays above to form one array
combo = digits + upcase + locase + symbols