Skip to main content

Generate random readable strings for various purposes

Project description

philiprehberger-randstr

Tests PyPI version License

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 charset
  • token(length=32) — URL-safe base64 token
  • password(length=16, symbols, min_symbols, min_digits, min_upper) — Strong password
  • hex_str(length=16) — Random hex string
  • uuid_short(length=8) — Short UUID-like hex ID

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

philiprehberger_randstr-0.1.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

philiprehberger_randstr-0.1.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file philiprehberger_randstr-0.1.3.tar.gz.

File metadata

  • Download URL: philiprehberger_randstr-0.1.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for philiprehberger_randstr-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6771fc4a94793ae4de673a0315894b4aaae7640748542c24b264898e7ea52350
MD5 ce432c65fdbeaf7d5858e0d5886497fd
BLAKE2b-256 c0b0a12ce00efaa46c10a6ce7a8569eb5a4a1c0ddebe3ebc3987113b80906a14

See more details on using hashes here.

File details

Details for the file philiprehberger_randstr-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for philiprehberger_randstr-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aa5469cf705f9e9d4b9b891e55a3d80b0af155ffa40c31e57251a0a25cd42584
MD5 31ab783743de9c24be6034ac34af8ccf
BLAKE2b-256 cc288b0220f4fd3c7c0b5ccfeea07be529e18649cd547fcfc1689fc13f1e0bb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page