0

Recently I've been getting into the whole idea of LCGs and Pseudorandom number generators. Anyway, I though that PHP should be a good starting point.

My question is, given a seeded number (done through srand() ) how does one predict the next number in the rand() sequence?

From what I understand the function should be something like (SEED * A + C) mod M How can I find the values of A, C, and M? And if I find those values, can I predict the next number in the sequence?

EDIT: Prior to version 7.0 where rand() becomes an alias of mt_rand()

Redseb
  • 199
  • 10

0 Answers0