remove secrets module for generating passwords until this works with python 3.6

This commit is contained in:
Jordan Rodgers 2018-02-11 22:02:06 -05:00
parent 4a2df4d979
commit c2c91b9f37

View file

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