3 ms·
I'm not in the cryptography or random space beyond using libraries, but these visualizations are very clever. It's easy to see major problems. edit: It shows s
by perspective1 7y ago
I'm not in the cryptography or random space beyond using libraries, but these visualizations are very clever. It's easy to see major problems.
edit: It shows small-periods but otherwise it's not all that useful (see below).
- jgrahamc 7y agoIt's easy to see some major problems, but take a look at this: https://random.isthe.link/?code=let+x+%3D+Date.now%28%29+%26+0xFFFFFFFF%3B%0Alet+y+%3D+45342%3B%0Alet+z+%3D+65453%3B%0Alet+w+%3D+z+%5E+y%3B%0Aw+%26%3D+0xFFFFFFFF%3B%0A%0Afunction+randomD%28%29+%0A%7B%0A+++++let+t+%3D+x%3B%0A+++++t+%5E%3D+t+<<+11%3B%0A+++++t+%26%3D+0xFFFFFFFF%3B%0A+++++t+%5E%3D+t+>>+8%3B%0A+++++t+%26%3D+0xFFFFFFFF%3B%0A%0A+++++x+%3D+y%3B+y+%3D+z%3B+z+%3D+w%3B%0A+%0A+++++w+%5E%3D+w+>>+19%3B%0A+++++w+%26%3D+0xFFFFFFFF%3B%0A+++++w+%5E%3D+t%3B%0A+++++w+%26%3D+0xFFFFFFFF%3B%0A%0A++++return+w%2F0xFFFFFFFF%3B%0A%7D%0A%0Aexport+default+randomD%3B https://random.isthe.link/?code=let+x+%3D+Date.now%28%29+%26... The random number generator here is used quite often in projects and it looks pretty random. But if you look at the code you can see that it has four numbers that store state and its output can be entirely predicted from those four numbers that are consecutive outputs of the RNG.
- tiborsaas 7y agoIt's quite useful if you want to see if your seeded RNG matches a high quality pRNG.
- perspective1 7y agoOh wow. At some point I've thrown up my hands and just used Pcg64 because people I trust but can't possibly verify recommended it. Your post reaffirms that that was the right decision (trusting others).
- jgrahamc 7y agoWorth reading Knuth on this and his attempt to create his own RNG and fail horribly: http://www.informit.com/articles/article.aspx?p=2221790 http://www.informit.com/articles/article.aspx?p=2221790