Skip to main content

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

Project description

RGE-256 Core (v1.0.6)

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.6.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.6-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rge256_core-1.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 91d60053bbff5adba1af9faacc013649f9d38f98e2d426fa43ae247ceba2283a
MD5 9d62c6f0ddf6bcffe744ed394da6ba7c
BLAKE2b-256 a6520d29ef8fa2ebf3565b31f767ac1bf4b7e839ab06a59c45f8e2ec08b3d669

See more details on using hashes here.

File details

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

File metadata

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

Hashes for rge256_core-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 eb3fb9c77b0fbf381a47256814498b4187977ade1a8be1d880b991e73dfd0058
MD5 cd76729b32e1f62ed5599c013134b052
BLAKE2b-256 2e6f335b4e89c4a9e0eb931c6bc4b9897d387ca0c3040600866327259e2b3626

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