mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-09-27 12:14:53 +02:00
update key generation function
This commit is contained in:
+3
-4
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
import secrets
|
||||
import os
|
||||
import random
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -27,7 +27,6 @@ def first_run(secret_file, base_dir):
|
||||
return secret_key
|
||||
|
||||
|
||||
|
||||
def get_random():
|
||||
choice = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
|
||||
return ''.join([random.SystemRandom().choice(choice) for i in range(50)])
|
||||
wordlist = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
|
||||
return ''.join(secrets.choice(wordlist) for _ in range(50))
|
||||
|
||||
Reference in New Issue
Block a user