mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] use cryptorandom to generate password
This commit is contained in:
parent
32d3a9940b
commit
c6b5284be8
1 changed files with 1 additions and 1 deletions
|
@ -2104,4 +2104,4 @@ def random_password(length=8):
|
|||
import random
|
||||
|
||||
char_set = string.ascii_uppercase + string.digits + string.ascii_lowercase
|
||||
return ''.join(random.sample(char_set, length))
|
||||
return ''.join([random.SystemRandom().choice(char_set) for x in range(length)])
|
||||
|
|
Loading…
Add table
Reference in a new issue