Just found one, Crypt::Random depend on /dev/random device, it really
does give random number no matter how fast I generate the number...
Sam.
sam wrote:
> Hi,
>
> I tried Math::Random and Math::Random::MT, but none of them can generate
> turely random number when I executed the following code in a short time
> frame (twice in a second):
>
> #!/usr/bin/perl
>
> #use Math::Random;
> use Math::Random::MT;
>
> $gen = Math::Random::MT->new($seed); # OR... $gen =
> Math::Random::MT->new(@seed);
>
> print $gen->rand(3)."\n";
>
> #$random = random_uniform();
> #$gmt = gmtime();
>
> #print "Random: " . $random . "-" . $gmt . "\n";
>
> I m trying to generate a transaction code for a data base table using
> the format of random-GMT
>
> Another question is how can I generate a gmt time in the format 92783456
> instead of "Thu Dec 23 15:02:08 2004"?
>
> Thanks
> Sam
|