Thanks for the update. I agree with deliberate approach. Implementations of random int and math.random() < X predominately use the upper bits. A different algorithm might make this distinction unnecessary, but would it improve current behavior to bitflip the result? (or reverse groups of bits <https://gist.githubusercontent.com/anonymous/d09668b289fc6e4e4666/raw/e73b0db8624c0134a555b58e92e432c097e8a3c2/random.js> )
Hard to determine goals of math.random since no documented specs or requirements. On Mon, Nov 23, 2015 at 12:40 AM, Yang Guo <[email protected]> wrote: > Thanks for pointing that out. I am aware of the issue. However, I'd like > to find a good alternative before replacing the existing one entirely. This > is not a security issue, and rushing to implement a new PRNG could do more > harm than keeping the old one until we found a good replacement. > > Yang > > On Mon, Nov 23, 2015, 04:30 Isaac Levy <[email protected]> wrote: > >> Did you see this comment >> <https://codereview.chromium.org/1462293002#msg12> on your review? >> >> The upper bits of an MWC are low entropy, so the upper bits of >>> >>> your xor'd result I believe will be pretty low entropy too. >>> >>> >> If the patch reduced entropy in the upper bits, then I don't think it >> accomplished its goal. Might be worth another look -- it can cause subtle >> issues <https://code.google.com/p/chromium/issues/detail?id=316359>, >> especially when behavior varies across platform (webkit/jsc uses crypto >> based generator) >> >> -- >> -- >> v8-dev mailing list >> [email protected] >> http://groups.google.com/group/v8-dev >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
