Skip to content

spence-tech/SuperRand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

🎲 SuperRand — True Randomness API

SuperRand is a real-time true random number generation (TRNG) service that provides access to randomness derived from a live physical entropy source, primarily natural electromagnetic noise.

Unlike pseudo-random systems, its outputs are effectively unpredictable and non-repeatable in practice, with no caching or reuse of entropy between requests.

This repository contains interactive demonstrations and example applications that showcase what can be built using SuperRand.

🚀 About SuperRand

SuperRand provides a flexible API for generating a wide range of truly random data types, including:

  • Booleans
  • Integers (within custom ranges)
  • Floating-point values
  • Strings (custom character sets)
  • Colours (RGB / RGBA)
  • UUIDs
  • Cryptographic keys (AES)
  • Binary seeds
  • Byte arrays
  • Timestamps
  • Lottery tickets (reducing & non-reducing)

🔒 Key Features

  • True randomness sourced from physical entropy (not algorithms)
  • Real-time generation — no pre-generated pools or caching
  • Statistically validated output across multiple test suites
  • No storage of generated values (privacy-first design)
  • Verification signatures — independently validate that randomness has not been altered in transit

📡 API Quick Example

curl -X POST "https://api.super-rand.io/v1/?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"request":"integer","min":1,"max":100}'

Example response:

{
  "res": 89,
  "jobType": "integer",
  "attempts": 0,
  "length": 1,
  "generatorUUID": "30eb5630e57430e5",
  "timestamp": "2026-04-13T06:16:50.452Z",
  "priority": 0
}

🎨 Demo Showcase

This repository hosts a collection of interactive demos and experiments that highlight the capabilities of true randomness.

Each demo is designed to be:

  • Visually interesting
  • Technically insightful
  • Easily extendable

🧪 Examples

🌈 Particle Simulator

A real-time generative visualisation driven entirely by true randomness.

  • Continuously renders particles with properties derived from live random input:

    • Position
    • Direction and velocity
    • Size
    • Colour
  • Uses concurrent entropy streams to generate particles in parallel

  • Produces an evolving, non-repeating visual output with no predefined patterns

  • Includes simple controls:

    • Pause/resume simulation
    • Clear all particles

Purpose: Demonstrate how true randomness can drive generative visuals, producing continuously evolving, unpredictable artwork.


🎟️ Lottery Ticket Simulator

A full-scale lottery simulation powered by true randomness, modelling both player outcomes and operator economics.

  • Generates large volumes of lottery tickets using true random input

  • Supports:

    • Standard entries
    • System tickets (multi-number combinations)
  • Performs an independent official draw after all tickets are created

  • Evaluates every game against the results using division-based prize rules

Simulation Outputs:

  • Player Perspective

    • Total spend vs winnings
    • Net outcome and return rate
  • Operator Perspective

    • Revenue, payout, and gross margin
    • Payout ratio and win rates
    • Division-level prize distribution
  • Statistical Diagnostics

    • Marginal distribution spread (standard deviation)
    • Serial overlap between consecutive games
    • Pairwise and triple frequency anomalies (Z-scores)
    • Gap analysis between number occurrences

Purpose: Explore lottery dynamics, expected returns, and statistical behaviour using true randomness at scale.


⚖️ Weighted Lottery Game Generator

A research-oriented tool for generating lottery games using weighted probability distributions driven by true randomness.

  • Accepts user-defined ball data with frequency indicators (e.g. weeks since last draw)

  • Transforms frequencies into weights using configurable curves:

    • Linear
    • Exponential
    • Logistic
  • Supports multiple sampling methods:

    • Efraimidis–Spirakis (weighted sampling without replacement)
    • Sequential weighted selection
  • Generates games based on weighted probabilities using true random input

  • Provides statistical analysis, including:

    • Actual vs expected appearances
    • Per-ball probability deltas
    • Shannon entropy of the distribution
  • Supports both formatted and JSON output

Purpose: Explore how weighted probability models influence outcomes, and analyse their statistical behaviour using true randomness.


🔀 Lottery Game Variation Generator

Generates controlled variations of a base lottery combination using true random input.

  • Starts from a user-defined base combination

  • Applies a mix of:

    • Full random replacements
    • Controlled positional shifts
  • Variation behaviour is influenced by a configurable scale parameter

  • Ensures all generated games:

    • Stay within the defined number range
    • Contain no duplicate values
  • Supports both formatted and JSON output

Purpose: Explore nearby combinations and controlled deviations using true randomness.

📁 Repository Structure

/examples
  /particle-simulator
  /lottery-simulator
  /weighted-generator
  /variation-generator

README.md

🛠️ Getting Started

  1. Clone the repository:

    git clone https://github.com/spence-tech/SuperRand.git
  2. Add your API key to the demo files — (look for YOUR_API_KEY in the scripts and replace it with your key)

  3. Open any demo in your browser:

    /examples/particle-simulator/index.html

🔑 Authentication

All API requests require an API key.

Create an account and generate your API key here:

👉 https://portal.super-rand.io

Once you have your key, include it in your requests:

https://api.super-rand.io/v1/?key=YOUR_API_KEY
wss://api.super-rand.io/v1/?key=YOUR_API_KEY

📊 Why True Randomness?

Pseudo-random generators (PRNGs) are deterministic — given the same seed, they produce the same output.

SuperRand uses physical entropy, meaning:

  • Outputs cannot be predicted
  • Outputs cannot be reproduced
  • Each request is genuinely unique

In practice, this matters for systems where predictability is a risk:

  • Cryptographic key generation
  • Fair gaming systems
  • Scientific simulations
  • High-integrity random sampling

⚠️ Disclaimer

Some demos (e.g. lottery tools) are provided for educational and research purposes only and do not improve chances of winning.

📄 License

MIT License — feel free to use, modify, and build upon these examples.

🤝 Contributing

Contributions are welcome!

If you've built something interesting with SuperRand:

  • Submit a PR
  • Share your demo
  • Help expand the showcase

📬 Contact

For support, documentation, and API access:

👉 https://super-rand.io

Contributors