rand

rand
api v1.3 · build e85a473 · updated 11/11/2026

A small service for generating cryptographically secure random data through a simple API.

USAGE:
  Base URL: https://rand.hacks.run

  GET /{encoding}/{byteLength}
  GET /nanoid/{nanoidLength}
  GET /uuid
  GET /uuidv7

ENCODINGS:
  hex, base64, base64url

IDS:
  nanoid, uuid, uuidv7

PARAMETERS:
  byteLength    1–1000 bytes
                default: 16

  nanoidLength  1–1000 chars
                default: 21

  - byteLength: optional, for encoded bytes.
  - nanoidLength: optional, for /nanoid.
    Shorter Nano IDs have a higher collision probability.
  - /uuid: UUIDv4; /uuidv7: UUIDv7 with a timestamp.
    Both: 36 characters including hyphens, no path parameters.

RESPONSE FORMAT:
  Plain text by default; ?json for compact JSON, ?pretty for JSON with two-space indentation. Flag values are ignored; ?pretty takes precedence. Unknown query parameters are ignored.

EXAMPLES:
  /hex/32
  /nanoid/12?json
  /uuid
  /uuidv7?pretty

ERRORS:
  - 400 for invalid length or unsupported UUID path parameters.
  - 404 for unmatched routes.
  Errors are plain text.

GITHUB:
  https://github.com/teplostanski/rand


GitHub