{
  "slug": "random-bytes",
  "name": "gizza-ai/random-bytes",
  "version": "0.1.0",
  "title": "Random Bytes Generator — Hex, Base64 or Byte Array — gizza.ai",
  "description": "Generate cryptographically secure random bytes and output them as hex, Base64, Base64URL, binary, decimal, a C array or a Python bytes literal.",
  "tags": [
    "random bytes generator",
    "generate random bytes",
    "random hex generator",
    "random base64 generator",
    "openssl rand alternative",
    "random byte array",
    "secure random key generator"
  ],
  "category": "data",
  "urls": {
    "page": "https://gizza.ai/tools/random-bytes/",
    "markdown": "https://gizza.ai/tools/random-bytes/index.md",
    "descriptor": "https://gizza.ai/tools/random-bytes/tool.json",
    "deep_link_example": "https://gizza.ai/tools/random-bytes/?bytes=32&count=1&encoding=hex&separator=auto&uppercase=true&output=text&seed_hex=00112233445566778899aabbccddeeff"
  },
  "cli": "gizza tool random-bytes 'bytes=32'",
  "tool": {
    "description": "Generate cryptographically secure random bytes locally and render those exact bytes in a chosen encoding. `bytes` (default 32 = 256 bits) sets the entropy; `encoding` sets the presentation: 'hex' (like openssl rand -hex), 'base64', 'base64url' (no padding), 'binary', 'decimal', 'c-array' ({ 0x1a, 0x2b }) or 'python-bytes' (b'\\x1a\\x2b'). `count` draws up to 100 independent values at once, `separator` inserts a byte separator for the per-byte encodings, and `uppercase` switches hex to capitals. Output as text with an entropy summary, or as json. Set `seed_hex` to derive the bytes deterministically from a seed instead of the RNG. Use this when you need a keyed number of BYTES (an AES key, HMAC secret, IV, salt or seed); for a target number of CHARACTERS from a chosen alphabet use the random-token-generator tool, and for human-typed passwords use password-generator.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "bytes": {
          "default": 32,
          "description": "How many random bytes each value contains (1-4096). Default 32, i.e. 256 bits — the size of an AES-256 key, a JWT/HMAC secret or a session token. Use 16 for 128 bits, 64 for 512 bits. The byte count fixes the entropy; the encoding only changes how many characters are printed (32 bytes = 64 hex characters = 44 base64 characters).",
          "maximum": 4096,
          "minimum": 1,
          "type": "integer"
        },
        "count": {
          "default": 1,
          "description": "How many independent values to draw (1-100). Default 1. Each value is a fresh draw and is printed on its own line. bytes x count may not exceed 8192 random bytes per run.",
          "maximum": 100,
          "minimum": 1,
          "type": "integer"
        },
        "encoding": {
          "default": "hex",
          "description": "How the bytes are written out: 'hex' (default, 2 lowercase hex digits per byte, same as openssl rand -hex), 'base64' (RFC 4648 standard alphabet with = padding, same as openssl rand -base64), 'base64url' (URL-safe alphabet, no padding — for tokens and JWT segments), 'binary' (8 bits per byte), 'decimal' (0-255 per byte), 'c-array' (a C initializer list like { 0x1a, 0x2b }) or 'python-bytes' (a literal like b'\\x1a\\x2b').",
          "enum": [
            "hex",
            "base64",
            "base64url",
            "binary",
            "decimal",
            "c-array",
            "python-bytes"
          ],
          "type": "string"
        },
        "output": {
          "default": "text",
          "description": "How the result is rendered: 'text' (default, one value per line plus a one-line summary of byte count, bit count, encoding and the equivalent openssl command) or 'json' (an object with count, bytes, bits, encoding, uppercase, deterministic and the values array).",
          "enum": [
            "text",
            "json"
          ],
          "type": "string"
        },
        "seed_hex": {
          "default": "",
          "description": "Optional 8-128 hex digits (4-64 bytes). Blank (the default) draws from the platform's cryptographic RNG, so every run differs — this is what you want for real keys. When set, the bytes are derived deterministically from the seed so the same seed always reproduces the same values: useful for tests, examples and shareable links, but such output is only as secret as the seed.",
          "type": "string"
        },
        "separator": {
          "default": "auto",
          "description": "Text placed between bytes, for the one-unit-per-byte encodings only (hex, binary, decimal). 'auto' (default) uses each encoding's convention: nothing for hex, a space for binary, a comma for decimal. 'none' joins them with nothing; 'space', 'colon' (MAC/fingerprint style), 'dash' and 'comma' insert that character. base64, base64url, c-array and python-bytes have no per-byte boundary to split, so they ignore this.",
          "enum": [
            "auto",
            "none",
            "space",
            "colon",
            "dash",
            "comma"
          ],
          "type": "string"
        },
        "uppercase": {
          "default": false,
          "description": "Uppercase the hex digits. Default false (lowercase, matching openssl). Applies to the 'hex' and 'c-array' encodings; base64, binary, decimal and python-bytes are unaffected.",
          "type": "boolean"
        }
      },
      "type": "object"
    }
  }
}