The Technical Foundations of Mesinja’s Design
Most pseudorandom number generators (PRNGs) used today are deterministic systems based on iterated algorithms. Each output depends on an initial seed and a sequence of internal state transitions. While this approach has practical advantages, it also introduces structural limitations.
Traditional PRNGs are typically ad hoc in design and lack formal guarantees about their long-term statistical properties. Many rely on empirical testing to demonstrate acceptable behaviour, but such tests offer no certainty that a generator will continue to perform well under all conditions or resist prediction or reverse-engineering as new methods of attack evolve.
These limitations are well understood and have been demonstrated in practice. As reliance on digital systems grows, there is an increasing need for approaches to randomness that are not only efficient, but grounded in more transparent and defensible foundations. Mesinja’s PRNG design takes a different path.
A fundamentally different basis
Mesinja RNGs generate output by concatenating blocks of digits, each of which is a sample of digits taken from a separate approximation of a transcendental number produced by solving a distinct transcendental equation structured such that its solution is a transcendental number.
Each output block is generated independently by solving a distinct transcendental equation which removes the inter-block dependency found in traditional PRNGs, where apparent randomness often arises from the complexity and feedback within iterative processes.
Empirical testing has shown that the resulting digit streams behave like very high-quality random sequences, even when evaluated at scale.
How Mesinja RNGs work (in conceptual terms)
Mesinja RNGs generate output by computing a sequence of transcendental number approximations. These are produced by solving a sequence of distinct transcendental equations (i.e., an equation involving at least one transcendental function, such as the exponential function, of the unknown variable being solved for).
Each equation is constructed such that, despite it being represented with finite-precision inputs, the leading digits of the approximate solution match those of the exact transcendental number solution.
To limit the risk of reverse-engineering, a portion of the leading digits from each approximation is discarded. A fixed-length block of digits is then taken from deeper within the number. Each block is selected according to a fixed scheme. The positions from which digits are extracted are not influenced by previous outputs, nor are they reused. This mitigates the risk of correlation or reverse-engineering.
The resulting digit blocks are combined into a continuous output stream. Statistical testing has shown that this approach produces output that appears to be indistinguishable from a uniform random sequence, even at large scale.
Why this approach performs so well
There are two results from number theory that are relevant here:
- Almost all real numbers are normal numbers; and
- Almost all real numbers are transcendental numbers.
A number is a normal number if each digit appears with equal frequency in the number’s expansion when an infinite number of digits is considered.
Although there is no general means of determining if a particular transcendental number is a normal number, it is highly likely that the sequences generated by the concatenation of the samples of digits taken from the approximate transcendental number solutions of each distinct transcendental equation will have excellent statistical properties.
Mesinja’s outputs have been tested at scale using standard statistical suites, including volumes of data up to 256 terabytes. These tests show no statistically significant deviation from uniformity across the tested outputs.
Empirical strength and test results
Mesinja RNGs have been tested using a range of established statistical test suites, including PractRand, TestU01, Dieharder, and the NIST Statistical Test Suite (STS). Each suite is designed to identify different types of non-random behaviour across large and varied datasets.
In Mesinja’s testing using PractRand, 256 terabytes of output (multi-threaded) were evaluated without any observed failure. This test suite is explicitly designed to identify weaknesses through large scale statistical analysis. There is, in principle, no upper limit to the volume of random numbers that can be tested using PractRand other than CPU time (this is not possible under other commonly used RNG testing software). PractRand offers the possibility of “testing to destruction” the output of any PRNG.
While statistical testing does not establish formal randomness, it provides a practical benchmark. Mesinja’s ability to pass across multiple suites, including at scale, offers reassurance that its output lacks the structural patterns and correlations found in other designs.
Further, it is possible to easily enlarge the state space of a Mesinja PRNG by changing the floating point precision applied to the algorithm.
Why it matters for today’s applications
Digital systems increasingly depend on high-quality randomness. Cryptographic protocols, fairness-sensitive mechanisms such as lotteries or online gaming, and large-scale simulations all rely on random number generators to ensure outputs are both statistically indistinguishable from true randomness and reproducible under defined parameters.
As these applications scale and come under greater scrutiny, the limitations of traditional PRNGs become more significant. Correlation, predictability, or lack of transparency may not be visible under casual inspection, but can undermine confidence or introduce systemic risk in production environments.
Mesinja RNGs offer a structurally distinct alternative. This is particularly relevant as quantum computing brings new analytical tools that may weaken existing generators.