Skip to content
Snippets Groups Projects
Commit 78f74db8 authored by Christopher R. Gabriel's avatar Christopher R. Gabriel
Browse files

use onlyascii

parent 86c75826
Branches direct-client
No related tags found
No related merge requests found
......@@ -20,9 +20,14 @@ def generate_simple():
# generate a new simple password based on a word
words = open(WORDS_FILES).readlines()
nice_words = [str(x).lower().strip() for x in words if len(x) < 9 and len(x) > 6 and "'" not in x]
sample = random.sample(nice_words,1)[0].strip()
seed = random.randint(10,100)
return sample+str(seed)
while True:
sample = random.sample(nice_words,1)[0].strip()
seed = random.randint(10,100)
try:
sample.encode('ascii')
return sample+str(seed)
except:
continue
else:
return generate_hard()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment