Most implementations of "srand" take an integer and will silently truncate decimal numbers. This means "srand(42)" will usually produce the same results as "srand(42.1)". To be safe, always pass "srand" an integer.most strings will evaluate to 0 !
You need a checksum to produce a (pseudo) unique integer. You could tryDB<116> srand 0 => 1 DB<117> rand => "0.17082803610629" DB<118> rand => "0.749901980484964" DB<119> srand hostname => 1 DB<120> rand => "0.17082803610629" DB<121> rand => "0.749901980484964" DB<122> 0+ hostname => 0
$seed += ord($_) for split //, hostname
But whats wrong with the IP?
Cheers Rolf
In reply to Re^2: How do I make a random shuffle deterministic?
by LanX
in thread How do I make a random shuffle deterministic?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |