Skip to main content

Core Python implementation of the RGE-256 ARX pseudorandom number generator

Project description

RGE-256 (Python Core): A 256-bit ARX Pseudorandom Number Generator

Author: Steven Reid
ORCID: 0009-0003-9132-3410
License: Apache 2.0
Core Algorithm Repository: https://github.com/RRG314/RGE-256-app
Live Demo: https://rrg314.github.io/RGE-256-app/
Preprint: https://zenodo.org/records/17713219

Security Notice

RGE-256 is not a cryptographically secure random number generator.
It must not be used for encryption, key generation, authentication, or any security-critical application.

Overview

This package provides the pure Python core implementation of the RGE-256 ARX pseudorandom number generator for deterministic simulation and research.

Installation

pip install rge256_core

Basic Usage

from rge256_core import RGE256
rng = RGE256(seed=12345)

x = rng.rand_uint32()
y = rng.random()
z = rng.randint(0, 100)
arr = rng.random_array(1000)

Domain Separation

rng = RGE256(seed=999, domain="physics")
rng2 = RGE256(seed=999, domain="graphics")

Monte Carlo Example

from rge256_core import RGE256
import math

rng = RGE256(seed=42)
inside = 0
N = 100000

for _ in range(N):
    x = rng.random() * 2 - 1
    y = rng.random() * 2 - 1
    if x*x + y*y <= 1:
        inside += 1

print(4 * inside / N)

Citation

Reid, Steven. “RGE-256: A 256-bit ARX Pseudorandom Number Generator.”
Zenodo (2025): https://zenodo.org/records/17713219
ORCID: 0009-0003-9132-3410

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.0.tar.gz (2.7 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.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rge256_core-1.0.0.tar.gz
  • Upload date:
  • Size: 2.7 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.0.tar.gz
Algorithm Hash digest
SHA256 b95e7c9fddf4fc41eb76a58084c062ad4a067ec0448e0b4c1063ba823da638a5
MD5 df00e827256df3dd6ad0779a12ace069
BLAKE2b-256 3cb3f5fe05ef3e04b6d582649eff1482ba352a8b127b4583ea3fba8056acee59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rge256_core-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af45c5ee18bce058f00b24237e7c5b4487b91dfc1b7183ea316294db18901055
MD5 38696aed611ec7109b8ced93d330017a
BLAKE2b-256 188f25337aeea7b5293f87688e631d2a56e14a03cbc4114e0443aa57e2074769

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