2 ms·
> seed your RNG with "random" values like the current time Good point. srand(time(NULL)) is a common, yet nondeterministic, seed. The caller clearly doesn't ex
by cpeterso 2y ago
> seed your RNG with "random" values like the current time
Good point. srand(time(NULL)) is a common, yet nondeterministic, seed. The caller clearly doesn't expect rand() to generate a particular sequence of numbers, so srand() could check whether the given seed looks like a time_t close to the current time() and, if it does, then use a proper CSPRNG instead.