mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Replace os.urandom(32).hex() with secrets.token_hex(32)
This commit is contained in:
parent
fac8e93815
commit
5a6a73e319
2 changed files with 4 additions and 3 deletions
|
|
@ -302,7 +302,7 @@ Or::
|
|||
|
||||
One way to generate a secure random secret is to use Python like this::
|
||||
|
||||
$ python3 -c 'import os; print(os.urandom(32).hex())'
|
||||
$ python3 -c 'import secrets; print(secrets.token_hex(32))'
|
||||
cdb19e94283a20f9d42cca50c5a4871c0aa07392db308755d60a1a5b9bb0fa52
|
||||
|
||||
Plugin authors make use of this signing mechanism in their plugins using :ref:`datasette_sign` and :ref:`datasette_unsign`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue