MSWS is a modern improvement of von Neumannβs 1949 Middle Square method. By adding a Weyl sequence with a golden ratio-derived increment, it achieves full period and passes statistical tests. The algorithm squares a 64-bit state, adds the Weyl counter, and extracts the middle 64 bits.
| Property | Value |
|---|---|
| Category | Random Number Generators |
| Sub-category | Deterministic PRNG |
| Security status | π Educational Only |
| Complexity | Beginner |
| Inventor | Bernard Widynski |
| Year | 2017 |
| Origin | πΊπΈ United States |
| Source | algorithms/random/msws.js |
| Parameter | Supported values |
|---|---|
| Seed sizes | 1 byte (8 bits) to 8 bytes (64 bits) |
| Flag | Value |
|---|---|
IsDeterministic |
Yes |
IsCryptographicallySecure |
No |
Status: π Educational Only
No vulnerabilities are recorded for this implementation.
3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β Seed 0: First output - C# reference implementation
| Field | Value |
|---|---|
seed |
0000000000000000 |
outputSize |
8 |
input |
null |
expected |
fffffffeb5ad4ece |
Vector 2 β Seed 1: First 5 outputs (40 bytes) - C# reference implementation
| Field | Value |
|---|---|
seed |
0000000000000001 |
outputSize |
40 |
input |
null |
expected |
fffffff8b5ad4ece7a742cd0c5a00d5a 193d8a560760f364c9207c7c8f3cc60e 71e0d56832c88399 |
Vector 3 β Seed 2: First 3 outputs - Additional verification
| Field | Value |
|---|---|
seed |
0000000000000002 |
outputSize |
24 |
input |
null |
expected |
ffffffeeb5ad4ece7032769fde65216fe7dd025969677be9 |