Random Number Generator
A random number generator produces integers across a chosen range using a cryptographically secure source.
Set a minimum and maximum, choose how many values you need, and optionally require that no value repeats. Unique selection uses a sparse Fisher–Yates shuffle, so it completes in one pass with no retry loop even when the requested count approaches the size of the range.
Options
| Name | Type | Default | Description |
|---|---|---|---|
count | integer | 10 | How many records to return, from 1 to 1000. |
min | integer | 1 | Lowest value, inclusive. |
max | integer | 100 | Highest value, inclusive. |
unique | boolean | false | Set to true for values with no repeats. |
Use cases
- Sampling: Pick random rows or identifiers from a known range.
- Load test inputs: Vary quantities, prices and identifiers in generated requests.
- Draws and allocation: Select unique winners or shard assignments without repeats.
REST API
GET /api/v1/numbers
curl "https://ukaddressgenerator.org/api/v1/numbers?count=10"
{ "status": "success", "count": 5, "min": 1, "max": 100, "unique": true, "data": [42, 7, 91, 13, 68] }
Frequently asked questions
- What happens if I ask for more unique values than the range contains?
The request is rejected with a clear message explaining how many distinct values the range holds, rather than looping forever.
- Is the randomness suitable for security purposes?
It uses a cryptographically secure source, but for secrets use the password generator or a dedicated key generator.