Generar token aleatorio
random-tokenGenera un token aleatorio de 1 a 256 bytes en hex, base64url o base58. Cuándo: hay que generar un identificador en este formato o leer los campos que lleva dentro. No para: generar IDs aleatorios compactos y seguros para URL (nanoid). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). No determinista: aleatorio salvo que se dé seed. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Generates a random token of 1-256 bytes encoded as hex, base64url or base58, e.g. for API keys or nonces. A seed is meant only for test fixtures. When: an identifier has to be generated in this format or its embedded fields decoded. Not for: generating compact URL-safe random IDs (nanoid). Side effects: none (read-only, no network access, no stored state). Not deterministic: random unless seed is given. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Optional seed. With a seed the output is reproducible; without one, cryptographically random bytes are used (string; optional; up to 256 chars). | |
| bytes | No | Number of random bytes (integer; optional; default 32; min 1; max 256). | |
| encoding | No | Output encoding (optional; one of: hex, base64url, base58; default "hex"). | hex |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bits | No | ||
| aviso | No | ||
| token | No |