rotor alternative?

Paul Rubin http
Thu Nov 20 17:30:54 EST 2003


Peter Hansen <peter at engcorp.com> writes:
> The docs for Py2.3 say: 
> """On Windows, this function returns wall-clock 
>    seconds elapsed since the first call to this function, as a floating 
>    point number, based on the Win32 function QueryPerformanceCounter(). 
>    The resolution is typically better than one microsecond. """
> 
> I wonder if the part about "since the first call to this function" would
> make this dangerous for your purposes.

I don't run Windows and don't want to use something Windows specific.
Although, "since the first call to this function" is probably ok.  All
that's needed is to get a unique number to initialize the internal
PRNG with.  Hopefully sometime, the Python library will include a C
extension to get secure random numbers from the Windows Crypto API.
On *nix, they are already generally available from /dev/urandom.




More information about the Python-list mailing list