Skip to main content

notrandom: Pseudorandom, 100% reproducible variable generators.

Implementation of the builtin ‘random’ API, which guarantees 100% deterministic and reproducible computation of values, regardless of python versions, operating system or environment (a guarantee that the ‘random’ module does not provide). Non randomness guaranteed!

For example, when seeding the generator with the integer 0, the those are the first 3 floating numbers, across all systems, Python Implementations and versions. Try it yourself!

>> from notrandom import random, seed
>> seed(0)
>> print(random(), random(), random())
0.40003172633476936 0.16874476805609495 0.07212944838504431

This package is based on the builtin ‘random’ module and strongly resembles its API, with only minor adjustments. In particular, all global functions of random are also available in notrandom, in addition to the notrandom.Random object which implements the random.Random api. Check out the test.py file for usage examples.

It is important to note that the values computed by the notrandom are actually not random at all, as the process is 100% deterministic (that is the whole point!). Obviously, it is not intended to be used cryptographically in any way or circumstance.

Behind the scenes, notrandom uses the cryptographic hash function SHA256, in a process that resembles the OFB mode of operation. The algorithm produces blocks of 256bits ad-hoc, by hashing the previous 256bit block using SHA256, where the initial block is derived from the key directly. Then using similar technics to the ones that ‘random’ uses, random floating point numbers and integers in range are derived when requested.

Metadata

Release files for notrandom 1.0.0

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

Source distribution (sdist)

Source distribution for notrandom 1.0.0
File Size Uploaded
notrandom-1.0.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for notrandom 1.0.0
File Interpreter ABI Platform
notrandom-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 kB

Release files / notrandom-1.0.0.tar.gz

Download URL notrandom-1.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8fc1073c2d17a8e5b7e1f54b55a614c09678ab54d9f0f64393b0525bef2c7f0c
BLAKE2b-256 checksum
How to use checksums
4101c836d5267fd5dce4324d40380e2ef53dd3e5a402eb40458ac48872bac5b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / notrandom-1.0.0-py3-none-any.whl

Download URL notrandom-1.0.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
effaa4c994a5a9f94ea872375a1766a7bc286f2eb64e8866917f26bd1ec741c6
BLAKE2b-256 checksum
How to use checksums
89a362134c7290dcef7a889dd5834fb3e018b79036bf851bc83cad42a7b52010
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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