Random...

Anton Vredegoor anton at vredegoor.doge.nl
Tue Mar 26 06:18:51 EST 2002


On Mon, 25 Mar 2002 18:52:25 +0100, "FREDRIK HULDTGREN"
<tdi01fhu at syd.kth.se> wrote:

>I want to generate random numbers, very large random numbers. If I use
>randrange() I get an out of bounds error since it only supports numbers
>up to (2**31)-1. However, I can use uniform(), but then I get the number
>returned in 7.9655120654553743e+018 or something simaler, and I would
>rather have it in a "L" format(796551206545537430183218312890381031L).
>How do I do this?

On a i810 - i850 type motherboard, and using windows as an OS there's
the possibility of using the intel 82802 firmware hub random number
generator:

http://home.hccnet.nl/a.vredegoor/truerand/truerand_0_1_1.zip

I wrote this extension some time ago and it works for me. I can give
no other indications about it working properly since I am still
waiting for someone to admit having been able to use it! If there's
some other source of random bytes, it could be made into a random long
number using a similar method.

Anton.




More information about the Python-list mailing list