diff --git a/proxstar/util.py b/proxstar/util.py index af587ea..d91cd45 100644 --- a/proxstar/util.py +++ b/proxstar/util.py @@ -1,8 +1,7 @@ -import secrets +import string +import random -def gen_password( - length, - charset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*" -): - return "".join([secrets.choice(charset) for _ in range(0, length)]) +def gen_password(length, charset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"): + # use secrets module once this works in python 3.6 + return ''.join(random.choice(charset) for x in range(length))