Message195975
> How about we generalize SystemRandom so users can implement
> a custom RNG class wby providing a method rng(amount) -> bytes?
The random module already makes it easy:
"""
Class Random can also be subclassed if you want to use a different basic generator of your own devising: in that case, override the random(), seed(), getstate(), and setstate() methods. Optionally, a new generator can supply a getrandbits() method — this allows randrange() to produce selections over an arbitrarily large range.
"""
> I showed that urandom is just a bit slower than SSL_rand().
"Just a bit" is relative, I read from 2 to 3 times slower, on Linux.
> I don't get it either. urandom is perfectly fine.
Alright, closing then. |
|
Date |
User |
Action |
Args |
2013-08-23 14:34:55 | neologix | set | recipients:
+ neologix, rhettinger, pitrou, vstinner, christian.heimes |
2013-08-23 14:34:55 | neologix | set | messageid: <1377268495.68.0.0309563777888.issue18811@psf.upfronthosting.co.za> |
2013-08-23 14:34:55 | neologix | link | issue18811 messages |
2013-08-23 14:34:55 | neologix | create | |
|