math_random_number_generator
Generate cryptographically secure random integers, floats, booleans, UUIDs, hex strings, or base64 bytes using CSPRNG with rejection sampling for unbiased results.
Instructions
Generate Cryptographically Secure Random Values. Generates uniform random integers, floats, booleans, UUIDs (v4/v7), hex strings, or base64-encoded bytes using crypto.getRandomValues (CSPRNG), with rejection sampling to eliminate modulo bias. Pick the value family with operation. Use this for one numeric or token-style value family per call; for fake structured records (names, emails, CSV/JSON rows) use data_random_data_generator instead. An optional seed switches to a deterministic xoshiro128** PRNG for reproducible output — never use seeded output for keys, salts, tokens, nonces, or IVs. Read-only, non-destructive, no auth; rate-limited to 60 requests/minute per client. Returns the generated values as an array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Value family to generate. Determines which other fields are required. | |
| min | No | Lower bound (required for integer/float; must be strictly less than max). Integers must be whole numbers. | |
| max | No | Upper bound (required for integer/float; must be strictly greater than min). | |
| count | No | How many values to generate (integer/float/boolean/uuid/hex/bytes). | |
| inclusive | No | Whether max is included in the range. Integer default true; float default false. Ignored by other operations. | |
| version | No | UUID layout, used only when operation is uuid. v4 is fully random; v7 is timestamp-ordered (RFC 9562). | v4 |
| length | No | Output length per value — hex character count, or raw byte count for bytes (base64 is longer). Required for hex/bytes. | |
| seed | No | Optional seed string for deterministic xoshiro128** output (reproducible, NOT cryptographically secure). Omit for CSPRNG. Max 1024 characters. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | True when generation succeeded. | |
| operation | No | The operation that was executed (echoed from the request). | |
| count | No | Number of values returned (length of values). | |
| values | No | Generated values: numbers for integer/float, booleans for boolean, or strings for uuid/hex/bytes (base64). | |
| error | No | Present only on failure (HTTP 400) with the validation message; omitted on success. |