Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index a057af5a..48de4cbe 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -2,8 +2,10 @@ import hashlib
import json
import logging
import os
+import secrets
import shlex
import subprocess
+import string
import sys
import time
from datetime import datetime, date
@@ -46,6 +48,9 @@ from .storage import storage
def gen_uid(entropy_length=256):
return hashlib.sha512(os.urandom(entropy_length)).hexdigest()
+def generate_password(length=64):
+ haystack = string.printable # digits, ascii_letters, punctiation (!"#$[] etc) and whitespace
+ return ''.join(secrets.choice(haystack) for i in range(length))
def multisplit(s, splitters):
s = [s, ]
@@ -61,7 +66,6 @@ def multisplit(s, splitters):
s = ns
return s
-
def locate_binary(name):
for PATH in os.environ['PATH'].split(':'):
for root, folders, files in os.walk(PATH):