mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 18:57:52 -06:00
Use secrets instead of random
Since we're no longer stuck on python 3.5, we can use secrets instead of random which provides better randomness. CURA-8401 SEC-207
This commit is contained in:
parent
3caee3f143
commit
e24a844d17
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
from datetime import datetime
|
||||
import json
|
||||
import random
|
||||
import secrets
|
||||
from hashlib import sha512
|
||||
from base64 import b64encode
|
||||
from typing import Optional
|
||||
|
@ -143,7 +143,7 @@ class AuthorizationHelpers:
|
|||
better to leave it at 32
|
||||
"""
|
||||
|
||||
return "".join(random.choice("0123456789ABCDEF") for i in range(code_length))
|
||||
return "".join(secrets.choice("0123456789ABCDEF") for i in range(code_length))
|
||||
|
||||
@staticmethod
|
||||
def generateVerificationCodeChallenge(verification_code: str) -> str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue