r/javascript • • Dec 05 '15

Microsoft Edge's JavaScript engine to go open-source

https://blogs.windows.com/msedgedev/2015/12/05/open-source-chakra-core/
317 Upvotes

84 comments sorted by

View all comments

Show parent comments

34

u/bterlson_ @bterlson Dec 05 '15

I don't know how to answer this. When in doubt, use Math.random() I always say.

Edit: this isn't an ama, but do you guys want one? I can try to set one up with the team. No promises of course :)

7

u/ivosaurus Dec 05 '15

New question: what RNG does your implementation of Math.random() use?

8

u/bterlson_ @bterlson Dec 05 '15

It's decent quality, if that's what you're asking. I don't know that it has a name per se. One of our devs recently posted more info here.

3

u/ivosaurus Dec 05 '15

Decent, as in the same one that was in use before 2002?

If it's indeed the same as Java's, then it's just a LCG. That is decidedly not decent quality.

12

u/bterlson_ @bterlson Dec 05 '15

"Decent" of course depends on use case. Math.random is decidedly NOT decent if you are doing any sort of cryptography, for example.

1

u/ivosaurus Dec 06 '15

Nope. Just statistically decent, which LCGs fail pretty hard.