CRT Random Number Generator

5 independent CRT channels mixed via ring arithmetic. CC0. No patents. No dependencies.

How It Works

Seed decomposes into 5 CRT channels: n mod {8, 9, 25, 49, 11}.

Each channel advances independently via multiplication by a primitive root.

Output = CRT reconstruction of mixed channels. The 5-way independence gives structural randomness.

Wide state: two 32-bit words (s0, s1). Period > 2^30.
step:
  1. xorshift on s0              -- standard bit mixing
  2. decompose s0 into 5 CRT channels (mod 8, 9, 25, 49, 11)
  3. nonlinear per-channel mixing -- each channel mixes with neighbors
  4. CRT reconstruct             -- the axiom's structural mixing
  5. advance s1 with CRT output  -- chains the two state words
output = (s0 XOR s1) mod 970200

Generate

Distribution (mod 256)

Chi-squared (uniform)
-
Period detected
-
Bit balance (0s vs 1s)
-
Serial correlation
-

2D Scatter (consecutive pairs)

Good RNG: uniform scatter. Bad RNG: visible patterns/lines.

Avalanche Test

Flip 1 bit of seed. How many output bits change?

Channel Independence

Each CRT channel should show independent statistics.

CC0 1.0 Universal - No Rights Reserved. CRT-based PRNG using Z/970200Z = Z/8 x Z/9 x Z/25 x Z/49 x Z/11.
5 independent channels, primitive root advancement, CRT reconstruction.
No patents. No dependencies. No permission needed. antonlebed.com