mirror of
https://github.com/solero/houdini.git
synced 2025-01-22 20:36:58 +00:00
Merge pull request #4 from Zaseth/patch-1
Use secrets.token_hex instead of a loop
This commit is contained in:
commit
500fd01717
@ -1,8 +1,5 @@
|
||||
import hashlib
|
||||
import secrets
|
||||
import string
|
||||
|
||||
_alphabet = string.ascii_letters + string.digits
|
||||
|
||||
|
||||
class Crypto:
|
||||
@ -15,7 +12,7 @@ class Crypto:
|
||||
|
||||
@staticmethod
|
||||
def generate_random_key():
|
||||
return ''.join(secrets.choice(_alphabet) for _ in range(16))
|
||||
return secrets.token_hex(8)
|
||||
|
||||
@staticmethod
|
||||
def encrypt_password(password, digest=True):
|
||||
|
Loading…
Reference in New Issue
Block a user