Skip to main content

RGE-256: A pure Python 256-bit ARX pseudorandom number generator.

Project description

RGE-256 Core (v1.0.3)

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 export
  • README.md
  • LICENSE
  • pyproject.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

rge256_core-1.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rge256_core-1.0.3-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file rge256_core-1.0.3.tar.gz.

File metadata

  • Download URL: rge256_core-1.0.3.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

Hashes for rge256_core-1.0.3.tar.gz
Algorithm Hash digest
SHA256 dfbfd2bd179f2b8c9cc312ddd857db7b6fef8234ba016bf76cd6f1ffdda71651
MD5 c0dee08a22e7aad44b69d244c15ff73f
BLAKE2b-256 505b278a2e3c6ad0ae8be68ae407466060a9f997e7568b17d82469442473fee9

See more details on using hashes here.

File details

Details for the file rge256_core-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: rge256_core-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for rge256_core-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f6574b788607aca768bdd0c52f26dcdec045c9eca34fae63368d107baff2a209
MD5 0d1eded1e9611e59e338c87b656820c6
BLAKE2b-256 1b32946dee187b71b4558ed8c4a450a2ee66c525f0ac3951560d6270bc522572

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page