on the prng behind random.random()

Ian Kelly ian.g.kelly at gmail.com
Mon Nov 19 17:07:27 EST 2018


On Mon, Nov 19, 2018 at 2:12 PM Robert Girault <r at dev.null> wrote:
>
> Chris Angelico <rosuav at gmail.com> writes:
>
> > On Tue, Nov 20, 2018 at 7:31 AM Robert Girault <r at dev.null> wrote:
> >> Nice.  So Python's random.random() does indeed use mt19937.  Since it's
> >> been broken for years, why isn't it replaced by something newer like
> >> ChaCha20?  Is it due to backward compatibility?  That would make sense.
> >
> > What exactly do you mean by "broken"?
>
> I mean the fact that with 624 samples from the generator, you can
> determine the rest of the sequence completely.
>
> Sorry about mentioning ChaCha20.  That was misleading.  I should've said
> something newer like mrtg32k3a or xorshift*.

If you wish to propose replacing it, that topic is probably best
brought up at python-dev.



More information about the Python-list mailing list