Skip to content

LCGRng Class ​

Definition ​

Provides a simple, deterministic pseudo-random number generator (PRNG) based on a Linear Congruential Generator (LCG).

  • Namespace: JASE
  • Assembly: JASE.dll

Methods ​

NameDescription
int Next(int seed, int min = null, int max = null)Generates a pseudo-random integer using a Linear Congruential Generator (LCG) with the specified seed and value range.
int Next(long seed, int min = null, int max = null)Generates a pseudo-random integer using a Linear Congruential Generator (LCG) from a 64-bit seed value.

Remarks ​

This implementation is intended only for non-cryptographic use cases such as lightweight simulations, test data generation, or repeatable pseudo-random sequences derived from a seeded input.

The generator uses several known LCG multipliers and selects one based on the current day of the year. Because a new multiplier may be chosen each day, sequences produced for the same seed are not guaranteed to be stable across dates.

Not suitable for cryptography or security-sensitive randomness.