in reply to Re: random question
in thread random question

I think there's a minuscule probability that this RNG leaves (at least) one number never to generate, shortening its ideal cycle. Potential fix:
sub generate_rng { my $seed = shift; my $count = 0; return sub { $seed = sha384_hex($seed . $count++); my $rnd = hex(substr($seed, 0, 4)); return $rnd; }; }

Take my methods with a grain of salt since I'm an amateur at best in this subject -- I wouldn't know a bad RNG from a good one.

Anyway, it appears that the OP is trying to increase the randomness of rand() by various voodoo methods. This is a futile task and he's much more likely to worsen it by making it more biassed. For example, a lot of newbies try to out-random random by saying rand() + rand() and getting a triangular distribution as a result.