Generate random readable strings for various purposes
Project description
philiprehberger-randstr
Generate random readable strings for various purposes.
Installation
pip install philiprehberger-randstr
Usage
from philiprehberger_randstr import randstr, token, password, hex_str, uuid_short
randstr(16) # "aBx4kLm9pQrS2tUv"
randstr(8, charset="lowercase") # "abcdefgh"
token(32) # URL-safe base64 token
password(16) # "aB3$kLm!9pQr#2tU"
hex_str(16) # "a1b2c3d4e5f6a7b8"
uuid_short() # "7f3a8b2c"
All generators use the secrets module for cryptographic security.
API
randstr(length=16, charset="alphanumeric")— Random string from charsettoken(length=32)— URL-safe base64 tokenpassword(length=16, symbols, min_symbols, min_digits, min_upper)— Strong passwordhex_str(length=16)— Random hex stringuuid_short(length=8)— Short UUID-like hex ID
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file philiprehberger_randstr-0.1.1.tar.gz.
File metadata
- Download URL: philiprehberger_randstr-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0a32af37473550663fea5ee4513018294aafe83eeade1477fecb09466c49678
|
|
| MD5 |
817447a431221b5f5d8b8c32983da613
|
|
| BLAKE2b-256 |
63e708f7697ab308a5b0d94734f2c3b986f71c477fa39d3c915b4965c76b57dd
|
File details
Details for the file philiprehberger_randstr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: philiprehberger_randstr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74d699d0f27a282f309df270888dc12dae7d8f9a0b600cf3e49af4fe69c04141
|
|
| MD5 |
9e214000fff4e96363cfc28e802c8b79
|
|
| BLAKE2b-256 |
5a326f7234b3286514c6eea4f7d2d125ae3adad65e197cfe18a0e6a027ccd3fa
|