in reply to Legacy code uses "srand()" .. how to avoid losing entropy?
I observe that srand() merely returns “1.”According to Perl 5.14’s perlfunc entry for srand:
The point of the function is to “seed” the rand function so that rand can produce a different sequence each time you run your program. When called with a parameter, srand uses that for the seed; otherwise it (semi-)randomly chooses a seed. In either case, starting with Perl 5.14, it returns the seed.
Which I believe is what you’re looking for.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Legacy code uses "srand()" .. how to avoid losing entropy?
by JavaFan (Canon) on May 04, 2011 at 00:22 UTC |