Generalized Feedback Shift Register is a shift-register-based PRNG using multiple feedback taps for long-period pseudo-random sequences. This gfsr4 variant uses a 521-word state with four-tap XOR recurrence, providing period 2^16672 and excellent statistical properties for simulations.
| Property | Value |
|---|---|
| Category | Random Number Generators |
| Sub-category | Deterministic PRNG |
| Security status | π Educational Only |
| Complexity | Intermediate |
| Inventor | Robert C. Tausworthe |
| Year | 1965 |
| Origin | πΊπΈ United States |
| Source | algorithms/random/gfsr.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.
6 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β Seed 0: First 8 outputs (32 bytes) - GFSR4 with LCG initialization
| Field | Value |
|---|---|
seed |
0000000000000000 |
outputSize |
32 |
input |
null |
expected |
537f23f9ea1b5be4c41deb635a2b06a67dd535fd9eb47108c8a5d597d93ad76a |
Vector 2 β Seed 1: First 8 outputs (32 bytes) - GFSR4 with LCG initialization
| Field | Value |
|---|---|
seed |
0000000000000001 |
outputSize |
32 |
input |
null |
expected |
047a197ef9ed3f55ff9cab80a578514f7ebddba23a4db9d97f512644fbb216c3 |
Vector 3 β Seed 42: First 8 outputs (32 bytes) - GFSR4 with LCG initialization
| Field | Value |
|---|---|
seed |
000000000000002a |
outputSize |
32 |
input |
null |
expected |
67824c1b3f3a8efe10793ad5ee72a500d31ca0cf359e7122772601598c47a1c4 |
Vector 4 β Seed 12345: First 5 outputs (20 bytes) - GFSR4 with LCG initialization
| Field | Value |
|---|---|
seed |
0000000000003039 |
outputSize |
20 |
input |
null |
expected |
7599787668d0218d03a2c8987599cda77c45717a |
Vector 5 β Seed 999999: First 5 outputs (20 bytes) - GFSR4 with LCG initialization
| Field | Value |
|---|---|
seed |
00000000000f423f |
outputSize |
20 |
input |
null |
expected |
76f44b44e17b17c390529606e34c6e5d2bc5a368 |
Vector 6 β Seed 0xFFFFFFFFFFFFFFFF: First 5 outputs (20 bytes) - all bits set
| Field | Value |
|---|---|
seed |
ffffffffffffffff |
outputSize |
20 |
input |
null |
expected |
8af1b704bf8e1183312e2cc6d2cb011d11b89a28 |