mirror of
https://github.com/creyD/creyPY.git
synced 2026-04-14 04:10:30 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 364e07daa1 | |||
| 5daf6eb8c5 |
@@ -1,4 +1,4 @@
|
|||||||
import random
|
import secrets
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
|
||||||
@@ -6,11 +6,11 @@ def create_random_password(length: int = 12) -> str:
|
|||||||
all_characters = string.ascii_letters + string.digits + string.punctuation
|
all_characters = string.ascii_letters + string.digits + string.punctuation
|
||||||
|
|
||||||
password = [
|
password = [
|
||||||
random.choice(string.ascii_lowercase),
|
secrets.choice(string.ascii_lowercase),
|
||||||
random.choice(string.ascii_uppercase),
|
secrets.choice(string.ascii_uppercase),
|
||||||
random.choice(string.digits),
|
secrets.choice(string.digits),
|
||||||
random.choice(string.punctuation),
|
secrets.choice(string.punctuation),
|
||||||
]
|
]
|
||||||
password += random.choices(all_characters, k=length - 4)
|
password += [secrets.choice(all_characters) for _ in range(length - 4)]
|
||||||
random.shuffle(password)
|
secrets.SystemRandom().shuffle(password)
|
||||||
return "".join(password)
|
return "".join(password)
|
||||||
|
|||||||
1
creyPY/services/__init__.py
Normal file
1
creyPY/services/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from .auth0 import * # noqa
|
||||||
Reference in New Issue
Block a user