RGE-256: A pure Python 256-bit ARX pseudorandom number generator.
Project description
RGE-256 Core (v1.0.5)
A pure Python 256-bit Add–Rotate–Xor (ARX) pseudorandom number generator.
Author: Steven Reid ORCID: 0009-0003-9132-3410 License: Apache 2.0 Repository: https://github.com/RRG314/RGE-256-app Preprint: https://zenodo.org/records/17713219
⚠️ Security Notice
RGE-256 Core is not a cryptographically secure random number generator.
It MUST NOT be used for:
- encryption
- authentication
- secure key generation
- tokens
- gambling systems
- lotteries
- blockchain consensus
It IS safe for:
- simulation
- Monte Carlo methods
- research
- teaching
- non-security randomness
Overview
RGE-256 Core is a simple, deterministic PRNG implemented in pure Python. It uses:
- a 256-bit internal state (8 × 32-bit words)
- Add–Rotate–XOR (ARX) mixing
- domain separation via string labels
- fixed-round mixing (default: 3 rounds)
- deterministic output using a 64-bit seed
This package contains only the core PRNG. No visualization, no statistical diagnostics, and no UI components are included.
Installation
pip install rge256_core
Basic Usage
from rge256_core import RGE256
rng = RGE256(seed=12345)
# 32-bit unsigned integer
x = rng.next_u32()
# float in [0, 1)
y = rng.next_float()
# integer in range
z = rng.randint(0, 100)
# N random bytes
b = rng.random_bytes(32)
RGE-256 Core is fully deterministic: the same seed + same domain always produces the same sequence.
Domain Separation
Domain labels create independent sequences even with the same seed:
rng_a = RGE256(seed=999, domain='physics')
rng_b = RGE256(seed=999, domain='graphics')
These produce completely different output streams.
Example: Monte Carlo π
from rge256_core import RGE256
import math
rng = RGE256(seed=42)
inside = 0
N = 100000
for _ in range(N):
x = rng.next_float() * 2 - 1
y = rng.next_float() * 2 - 1
if x*x + y*y <= 1:
inside += 1
pi_estimate = 4 * inside / N
print(pi_estimate)
Project Structure
The pip package includes only the core PRNG module:
rge256_core/rge256_core.py— core PRNG implementation__init__.py— module exportREADME.mdLICENSEpyproject.toml
No web demo features are included in the pip package.
Citation
Reid, Steven. “RGE-256: A 256-bit ARX Pseudorandom Number Generator.” Zenodo (2025). https://zenodo.org/records/17713219
License
Apache License 2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rge256_core-1.0.5.tar.gz.
File metadata
- Download URL: rge256_core-1.0.5.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee1d6611319765d1f79613abbe2e5a9bbfc4c11fca2143d8a57ecb1f5446cc0
|
|
| MD5 |
9ec54e4af0559bd156e3debeba3bc603
|
|
| BLAKE2b-256 |
9144dc17a6f139cdd87d3e10fb0090397dc9d50eab90f77973ea8fb104d7aea3
|
File details
Details for the file rge256_core-1.0.5-py3-none-any.whl.
File metadata
- Download URL: rge256_core-1.0.5-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ede803832893061baf2c9201edeb172739aaa3239b790ea20bd8819dfae24bf3
|
|
| MD5 |
b241b797cc7586504eb5254e5c353ad7
|
|
| BLAKE2b-256 |
ace816905ecc4e35878ddcd1a3c13ed1407e3269235436a63a3b31c0b814ccba
|