PRNG - currently available solutions aren't addressing many use cases

Ron Waldon jokeyrhyme at gmail.com
Wed Dec 2 01:31:27 UTC 2015


>
> ---------- Forwarded message ----------
> From: "Michał Wadas" <michalwadas at gmail.com>
> To: es-discuss at mozilla.org
> Cc:
> Date: Tue, 1 Dec 2015 20:20:34 +0100
> Subject: PRNG - currently available solutions aren't addressing many use
> cases
>

...

> - not seedable
>
Chance JS is a fairly prominent high-level JavaScript library for this
purpose, has a configurable seed, implements a Mersenne Twister, does not
use Math.random(), but is likely in the PRNG class, not in the CSPRNG class:
http://chancejs.com/#seed

That said, it would be interesting if some of the ES2015 primitives had
built-in random generators: synchronous for PRNG, and asynchronous for
CSPRNG. e.g.

Boolean.random() => Boolean
Boolean.randomCS(callback?) => Promise

Number.randomInt(min, max) => Number
Number.randomIntCS(min, max, callback?) => Promise

etc...

But these can be and are implemented just fine at the user-land level. As
such, it's hard to justify making the standard library larger for this
purpose.

For CSPRNG purposes, however, it could be valuable to standardise either
Node.js crypto module, the window.crypto, or something new (that supports
seeds)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151202/658668d1/attachment.html>


More information about the es-discuss mailing list