fix: removed hard-coded length

This commit is contained in:
xpk
2025-11-25 12:24:22 +08:00
parent c223080874
commit fc355b6b55
+1 -1
View File
@@ -21,7 +21,7 @@ def generate_password(names: int) -> str:
def generate_insane_password(length: int) -> str:
ascii_pool: str = ''.join(chr(i) for i in chain(range(40, 127), range(180, 256)))
return ''.join(secrets.choice(ascii_pool) for _ in range(20))
return ''.join(secrets.choice(ascii_pool) for _ in range(length))
if __name__ == '__main__':
if len(sys.argv) <= 1: