Skip to main content

gregs_rng

A package for generating random numbers using various methods. The current version only supports the Linear Congruential Method.

Linear Congruential Generator:

W. E. Thompson. 1958. A Modified Congruence Method of Generating Pseudo-Random Numbers. The Computer Journal 1, 2 (1958), 83–88. https://academic.oup.com/comjnl/article-abstract/1/2/83/425243

A. Rotenberg. 1960. A New Pseudo-Random Number Generator. Journal of the ACM 7, 1 (1960), 75–77. https://dl.acm.org/doi/10.1145/321008.321019 https://en.wikipedia.org/wiki/Linear_congruential_generator

Choice of parameters for LCG:

Donald E. Knuth (1981). The Art of Computer Programming, Volume 2: Seminumerical Algorithms (2nd ed.). Addison-Wesley. https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming

Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P. Numerical Recipes in C: The Art of Scientific Computing, 2nd ed., Cambridge University Press, 1992. https://en.wikipedia.org/wiki/Numerical_Recipes

Mersenne Twister:

Makoto Matsumoto and Takuji Nishimura. 1998. Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator. ACM Transactions on Modeling and Computer Simulation 8, 1 (1998), 3–30. https://dl.acm.org/doi/10.1145/272991.272995 https://en.wikipedia.org/wiki/Mersenne_Twister

Install:

pip install gregs_rng

Import and Use:

from gregs_rng import lcg, mtg

g = lcg(42)
print(next(g))
print(next(g))

g2 = mtg(42)
print(next(g2))
print(next(g2))

Metadata

Release files for gregs-rng 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gregs-rng 1.0.1
File Size Uploaded Provenance Actions
gregs_rng-1.0.1.tar.gz 21.8 kB With provenance Details for gregs_rng-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gregs-rng 1.0.1
File Interpreter ABI Platform Actions
gregs_rng-1.0.1-py3-none-any.whl Python 3 none any Details for gregs_rng-1.0.1-py3-none-any.whl

Total release size: 26.7 kB

Release files / gregs_rng-1.0.1.tar.gz

Download URL gregs_rng-1.0.1.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7f0708d1dff532faf90c91228e4accb2231f98506336048f481717c7e70f8d8a
BLAKE2b-256 checksum
How to use checksums
7c76e2a417340dcfd27fa55282275e91dcd131d4af9ba7d6e2572547ba8ceeae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Release files / gregs_rng-1.0.1-py3-none-any.whl

Download URL gregs_rng-1.0.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06ad47593f12143edfeb9b81176d7f4ac5ac4ab8f945c27820848e30a8cdc467
BLAKE2b-256 checksum
How to use checksums
631ecf8d9d86edf9a95bb2dc778f4d62b27dea70789338c7f1abae0f15443523
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

Security for gregs-rng 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gregs_rng-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page