random
Generate cryptographically secure random bytes, tokens, or passphrases using OS-level randomness. Choose from hex, base64, URL-safe, alphanumeric strings, or diceware-style passphrases.
Instructions
Generate cryptographically secure random bytes, a token, or a passphrase.
All randomness is drawn from the OS CSPRNG (secrets). kind selects the
shape and which sizing arg applies: bytes|hex|urlsafe draw nbytes (default
32) random bytes — bytes renders them via output_format (hex/base64), hex
is the same bytes as hex, urlsafe is RFC 4648 url-safe base64; token is a
length-character (default 32) alphanumeric [A-Za-z0-9] string; passphrase
joins words (default 6) words with separator (default '-'), drawn from
wordlist or the bundled EFF large diceware list. Returns {kind, value,
entropy_bits}; the value is the only secret and is never logged elsewhere.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | urlsafe | |
| length | No | ||
| nbytes | No | ||
| words | No | ||
| separator | No | - | |
| wordlist | No | ||
| output_format | No | hex |