strings that are ✨ random ✨
Project description
random-strings
Generate strings that are ✨ random ✨
how to install
$ pip install random-strings
how to use
>>> from random_strings import random_string
>>> random_string(5)
'YSuz5'
advanced usage
from random_strings import random_hex, random_string as randstr
password = randstr(16)
SECRET_KEY = randstr(64)
verification_code = randstr(12)
verification_code = randstr(12,upper=False) # no uppercase letters
verification_code = randstr(12,lower=False,digit=False) # only uppercase letters
SECURE_TOKEN = random_hex(128)
more examples
>>> from random_strings import *
>>> random_hex(16)
'ec583ef0aaa226cba9cb07e3dc2e623c'
>>> random_uuid()
'85273146-3ad8-489f-9964-e7af16ab6a26'
>>> random_uuid(dashes=False)
'a33ee36ad08242e4a2a819147f084a51'
more details
Generated strings are suitable for cryptographically secure usecase
See os.urandom
, random.SystemRandom
and PEP 506 for more details on how it works.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
random-strings-0.1.0.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file random-strings-0.1.0.tar.gz
.
File metadata
- Download URL: random-strings-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1e2b9e1db482a217952349c4e99c2684f3b4bd7d219802f5c22edb3f59198e2 |
|
MD5 | 2ca85840a8425934fcdbbda2729551ef |
|
BLAKE2b-256 | 4d59270afd6a8900ca3b5161f572630f42f3cdb501021b1a4f4d0c8d15d31964 |
File details
Details for the file random_strings-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: random_strings-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f638437c22d8ae7e0e76d8cbe840d4c74e6c9bbb6feea689be67e37e4c4a908d |
|
MD5 | 92311e3c96f5a18d1c77857f0b71f960 |
|
BLAKE2b-256 | 64b76110803bf3e9aa94bf82c24f3a07e253bb262b4f8680d8bf09e306f95da8 |