From fc355b6b550ce439e006e2bf5dc477acdc90d477 Mon Sep 17 00:00:00 2001 From: xpk Date: Tue, 25 Nov 2025 12:24:22 +0800 Subject: [PATCH] fix: removed hard-coded length --- py/pwgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/pwgen.py b/py/pwgen.py index ce787ff..369c688 100755 --- a/py/pwgen.py +++ b/py/pwgen.py @@ -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: