summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 447eef9..c4cfb37 100644
--- a/utils.py
+++ b/utils.py
@@ -18,7 +18,7 @@
#################################################################################
# Util Module, forcefully inheirted by all modules
-import time, hashlib, datetime, uuid
+import time, hashlib, datetime, uuid, string, secrets
import json, zlib, base64
# Set server debug level
@@ -50,6 +50,10 @@ def md5salt(string):
def create_token():
return uuid.uuid4().hex
+def create_password(size=32):
+ alphabet = string.ascii_uppercase + string.digits
+ return ''.join(secrets.choice(alphabet) for i in range(size))
+
def now():
return int(time.time())