diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2021-01-13 20:40:40 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-13 20:40:40 +0100 |
| commit | 64cc9dcdad0b60003f54b68e8cb8db715dbdc5ad (patch) | |
| tree | 4f469b5d58a8c1936455bf4b0f8a867d47a85b40 /django/utils/crypto.py | |
| parent | 920448539631b52dcee53bd32a880abbc9de18bd (diff) | |
Refs #31358 -- Added constant for get_random_string()'s default alphabet.
Diffstat (limited to 'django/utils/crypto.py')
| -rw-r--r-- | django/utils/crypto.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/django/utils/crypto.py b/django/utils/crypto.py index 3837e64e05..4fb3a9da9d 100644 --- a/django/utils/crypto.py +++ b/django/utils/crypto.py @@ -47,14 +47,12 @@ def salted_hmac(key_salt, value, secret=None, *, algorithm='sha1'): NOT_PROVIDED = object() # RemovedInDjango40Warning. +RANDOM_STRING_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' # RemovedInDjango40Warning: when the deprecation ends, replace with: -# def get_random_string(length, allowed_chars='...'): -def get_random_string(length=NOT_PROVIDED, allowed_chars=( - 'abcdefghijklmnopqrstuvwxyz' - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' -)): +# def get_random_string(length, allowed_chars=RANDOM_STRING_CHARS): +def get_random_string(length=NOT_PROVIDED, allowed_chars=RANDOM_STRING_CHARS): """ Return a securely generated random string. |
