diff options
| author | Cody Logan <clpo13@gmail.com> | 2020-01-08 08:58:56 -0800 |
|---|---|---|
| committer | Cody Logan <clpo13@gmail.com> | 2020-01-08 08:58:56 -0800 |
| commit | f97fefad37d65dece3fc8047e8d7ea874ec26906 (patch) | |
| tree | e67aca2a1152404531a95d2b8b290b120011449c /alphanum | |
| parent | aec984ee9dbcd14856c189eee12106753b1be9c1 (diff) | |
| download | alphanum-f97fefad37d65dece3fc8047e8d7ea874ec26906.tar.gz alphanum-f97fefad37d65dece3fc8047e8d7ea874ec26906.zip | |
Use SystemRandom()
Diffstat (limited to 'alphanum')
| -rw-r--r-- | alphanum/__init__.py | 2 | ||||
| -rw-r--r-- | alphanum/alphanum.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/alphanum/__init__.py b/alphanum/__init__.py index 7817cb2..03894dd 100644 --- a/alphanum/__init__.py +++ b/alphanum/__init__.py @@ -1,3 +1,3 @@ from .alphanum import generate # noqa: F401 -__version__ = '0.1.0' +__version__ = '0.2.0dev1' diff --git a/alphanum/alphanum.py b/alphanum/alphanum.py index 6fc2f03..3272f6c 100644 --- a/alphanum/alphanum.py +++ b/alphanum/alphanum.py @@ -1,5 +1,7 @@ -from random import choices +import random + +POP = 'abcdefghijklmnopqrstuvwxyz0123456789' def generate(length=1) -> str: - return ''.join(choices('abcdefghijklmnopqrstuvwxyz0123456789', k=length)) + return ''.join(random.SystemRandom().choices(POP, k=length)) |
