lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> -----Original Message-----
> From: [] On
> Behalf Of Liam Devine
> Sent: zaterdag 22 maart 2014 11:49
> To: Lua mailing list
> Subject: Re: [proposal] Concerns about math.random
> On 22/03/14 10:16, Jeremy Ong wrote:
> >
> > That said,
> > I think the documentation should make it clear that math.random will
> > not produce good results and shouldn't be used for any crypto
> > whatsoever.
> >
> Well, it basically already says that in a clear mannor:
> "This function is an interface to the simple pseudo-random generator
> function rand provided by Standard C. (No guarantees can be given for
> its statistical properties.)"
> --
> Liam

Correct, but it has no mention of the dangers of an overflow for the seed (I would welcome a default protection that the seed would only use the least significant bits in case of an overflow, instead of silently letting go of all randomness)