Re:Predictably Random
by soVeryTired on Tuesday August 13, 2019 @09:30AM
(#20685608)
RNGs are like crypto: don't roll your own! There's some really deep number theory behind many of them. Every RNG I've seen lets you control the seed, so I'm not sure what he gains by writing his own.
[ Parent
| on HN ]
Javascript doesn't allow setting the seed: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Re:Predictably Random
by strenholme on Tuesday August 13, 2019 @10:27AM
(#20686131)
Probably time to use a third party RNG for Javascript then. For example, https://gist.github.com/banksean/300494 or, if you don’t like MT19937 (shameless plug) https://github.com/samboy/rg32hash/blob/master/rg32.js
Re:Predictably Random
by soVeryTired on Tuesday August 13, 2019 @09:59AM
(#20685884)
Yikes!