Generate Reproducible Streams

Set the seed, mixing rounds, zeta parameters, and domain. The browser output is deterministic for the same configuration, and the Random Seed button now initializes a fresh RGE256Safe stream immediately.

Generator Configuration

What is RGE-256?

This app generates values with the in-page RGE256Safe PRNG: a 256-bit ARX state, fixed rotations, and a 64-bit counter mixed into every 32-bit output. Browser entropy is used only when you ask the app to suggest a new seed.

Starting point for random sequence (0xC0FFEE in decimal)
More rounds = better diffusion, slower generation
Triangle entropy constant (default: 1.585)
Menger-like entropy constant (default: 1.926)
Tetrahedral entropy constant (default: 1.262)
Optional: Different domains produce different sequences

Number Generation

💡 For good visualizations: use 1,000+ numbers. For statistical tests: use 10,000+
💡 For true continuous floats (0.0-1.0), use 32-bit Unsigned then switch to Floats tab
Click "Generate Numbers" to begin...

Inspect Output Quality

These browser checks are quick diagnostics for exploration. They are not a substitute for PractRand, dieharder, TestU01 Crush, or other full statistical batteries.

Statistical Analysis

Numbers Generated
0
Mean Value
-
Min / Max
- / -
Std Deviation
-
Entropy
-
Ideal = 100% Current: -
Chi-Square Statistic
-
Lower is better Expected ≈ -
KS Statistic
-
- -

Distribution Visualization

📊 What am I seeing?

Generate numbers to see distribution analysis.

Performance & Benchmarks

Generation Speed
-
numbers per second
Last Generation Time
-
milliseconds
Total Generated
0
all time
Generator Status
Not Initialized

RGE256Safe PRNG Guide

This tab explains what the browser generator does, what each control changes, and how to discuss the algorithm professionally without overstating it. RGE256Safe is deterministic, seedable, and intended for simulation, teaching, and research-facing experiments, not cryptography.

What A PRNG Does

A pseudorandom number generator is a deterministic state machine. It starts from a seed, repeatedly updates an internal state, and emits numbers that should look pattern-free under statistical inspection.

Seed + domain
256-bit state
ARX mixing
64-bit counter
32-bit output
Same configuration means same stream. Change the seed, domain, rounds, or zeta values and the stream changes.

Active Browser Generator

The app instantiates RGE256Safe, not the older comparison prototype. It keeps eight 32-bit words as the main state and two 32-bit counter words as a 64-bit monotonic counter.

  • State: 8 x 32-bit words = 256 bits.
  • Counter: mixed into every emitted value.
  • Output: unsigned 32-bit words, then optionally mapped to ranges.
  • Purpose: reproducible non-cryptographic random streams.

How One Output Is Produced

  1. Initialize state from the seed, domain string, and zeta controls.
  2. Run the selected number of ARX rounds.
  3. Each round performs add, rotate, and XOR operations across state lanes.
  4. Cross-mix the lanes so changes spread through the state.
  5. Increment the 64-bit counter and fold it into the output word.
s[0] += s[1]; s[1] = rotl32(s[1] ^ s[0], 7) s[2] += s[3]; s[3] = rotl32(s[3] ^ s[2], 9) s[4] += s[5]; s[5] = rotl32(s[5] ^ s[4], 13) s[6] += s[7]; s[7] = rotl32(s[7] ^ s[6], 18)

What The Controls Mean

  • Seed: the reproducible starting value. Record it with every result.
  • Rounds: more rounds increase diffusion and reduce speed.
  • Zeta values: folded into initial state expansion for stream variation.
  • Domain: separates independent streams under the same seed.
  • Range: display mapping only. External batteries should use raw 32-bit output.

What The Browser Checks Mean

The app's charts and quick tests are fast sanity checks. They can reveal obvious bias or broken wiring, but they do not replace long-run statistical batteries.

  • Histogram: checks rough uniformity over the selected range.
  • Entropy: estimates observed information content for the sample.
  • KS test: compares the sample to a uniform distribution.
  • Bit views: look for imbalance in bit positions and transitions.

Claims Boundary

Professional reporting should separate observed test results from security claims. Passing statistical batteries does not make a generator cryptographically secure.

Use RGE256Safe for research, teaching, Monte Carlo, procedural generation, and reproducibility experiments. Do not use it for keys, passwords, authentication, gambling, finance, medical, or safety-critical systems.

External Statistical Testing

The app does not run PractRand, dieharder, or TestU01 in the browser. Use the included stream generator and harnesses in your own environment, then copy summarized results back into this app or the README when you have completed a battery.

1. Generate A Raw Stream

Use raw little-endian 32-bit output for serious batteries. Avoid custom ranges, CSV, JSON, or formatted text unless a test explicitly asks for text.

node scripts/rge256-stream.mjs --seed 3405691 --count 1000000 --format raw > rge256-u32le.bin node scripts/rge256-stream.mjs --seed 3405691 --count 262144 --format raw > sample-1mib.bin

PractRand

PractRand is stream-oriented. Pipe unbounded 32-bit output into RNG_test stdin32 and stop at the data volume you want to report.

node scripts/rge256-stream.mjs --seed 3405691 --format raw | RNG_test stdin32 node scripts/rge256-stream.mjs --seed 3405691 --format raw | RNG_test stdin32 -tlmin 32MB -tlmax 16GB

dieharder

dieharder can read raw binary from stdin with generator 200. Run the full battery, save the output, and report pass/weak/fail counts with command details.

node scripts/rge256-stream.mjs --seed 3405691 --format raw | dieharder -g 200 -a node scripts/rge256-stream.mjs --seed 3405691 --format raw | dieharder -g 200 -d 0

TestU01 Crush / BigCrush

TestU01 is a C library. Compile the included harness against TestU01 and choose SmallCrush, Crush, or BigCrush. BigCrush can take a long time.

cc tools/testu01-rge256.c -o testu01-rge256 -ltestu01 -lprobdist -lmylib -lm ./testu01-rge256 --battery smallcrush --seed 3405691 ./testu01-rge256 --battery crush --seed 3405691 ./testu01-rge256 --battery bigcrush --seed 3405691

What To Record

  • Generator version or commit hash.
  • Seed, rounds, zeta values, and domain string.
  • Tool name, version, battery, and exact command.
  • Total bytes or samples consumed.
  • Pass, weak, suspicious, and fail counts.
  • Full raw logs as artifacts, not only screenshots.

Interpreting Results

A clean battery result is evidence that the tested stream did not trigger that suite's detectors at that data volume. It is not proof of randomness, unpredictability, or cryptographic security.

When adding results back to the app, phrase them as empirical observations: "No failures observed through X GB under PractRand with seed Y," not as absolute guarantees.

Validation Results Ledger

Use this table for published results after the external batteries finish. Keep pending rows until a complete tool log is available.

Battery Configuration Data Volume Observed Result Status
PractRand seed 3405691, rounds 3, domain rge-demo Pending Awaiting external run and saved log. Not run
dieharder seed 3405691, rounds 3, domain rge-demo Pending Awaiting full pass / weak / fail summary. Not run
TestU01 Crush seed 3405691, rounds 3, domain rge-demo Pending Awaiting SmallCrush, Crush, or BigCrush report. Not run

Use The Stream In Simple Systems

These examples show how the generator behaves in familiar probability workflows. They are teaching demos, not validation batteries.

🎮 Interactive Demos & Games

See RGE-256 in action with classic probability applications!

🎲 Dice Roller

Roll virtual dice using RGE-256

🎲
Click "Roll Dice" to start!
Rolls: 0 Average: -

🪙 Coin Flipper

Flip coins and track statistics

🪙
Click "Flip Coins" to start!
Heads: 0 (0%) Tails: 0 (0%)

🃏 Card Drawer

Draw random playing cards from a deck

🃏
Click "Draw Cards" to start!
Cards drawn: 0 / 52

🎰 Lottery Numbers

Generate lottery-style numbers

🎰
Click "Generate Numbers" to start!