Charles-François Natali added the comment:

> 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.

----------
resolution:  -> rejected
stage: needs patch -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18811>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to