first commit
This commit is contained in:
10
misc/random_string.py
Normal file
10
misc/random_string.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import secrets
|
||||
import string
|
||||
|
||||
def generate_secure_string(length):
|
||||
if length <= 0:
|
||||
return ""
|
||||
|
||||
characters = string.ascii_letters + string.digits
|
||||
return ''.join(secrets.choice(characters) for _ in range(length))
|
||||
|
||||
Reference in New Issue
Block a user