chore: replace pseudo-random generators with secrets module (#20616)
This commit is contained in:
parent
4f0c9fdf2b
commit
c1a13fa553
8 changed files with 17 additions and 16 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import json
|
||||
import logging
|
||||
import random
|
||||
import re
|
||||
import secrets
|
||||
import string
|
||||
import subprocess
|
||||
import time
|
||||
|
|
@ -176,7 +176,7 @@ def generate_string(n):
|
|||
letters_digits = string.ascii_letters + string.digits
|
||||
result = ""
|
||||
for i in range(n):
|
||||
result += random.choice(letters_digits)
|
||||
result += secrets.choice(letters_digits)
|
||||
|
||||
return result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue