4 ms·
I think seeded randomness is wildly underused. It's much more often the case I was deterministic randomness rather than based on my system clock. It's nice to
by jasonjmcghee 3y ago
I think seeded randomness is wildly underused. It's much more often the case I was deterministic randomness rather than based on my system clock.
It's nice to see aimless.js support it.
Crazy to me that `Math.random` doesn't accept a seed as an optional param.
- quickthrower2 3y agoYes, the obvious case is machine learning, so that you can make changes and run your program again, and it uses the same batches as so forth. Another case are unit tests with random-generated cases. At a minimum you want to know the seed of the last run and have that reported. On CI system you would want it to be deterministic. Where you want there not to be a seed is in crypto, or possibly a game like poker or even tetris.
- explaininjs 3y agoI’d argue that in poker you must use seeded randomness — but everyone has to contribute to the random “pool”. This is the only way I know of to have effectively random values with zero trust.
- gmac 3y agoAgreed. That’s why I did this (although the Mersenne Twister is probably a rather outdated way to go): https://github.com/jawj/mtwist https://github.com/jawj/mtwist
- sebstefan 3y agoI was really surprised when I discovered JS didn't have seeded randomness I had to make one myself and I never thought it'd be something I'd ever need to do