Created
August 23, 2017 22:30
-
-
Save jimthedev/c36492c3fb495d86428c0798495c050a to your computer and use it in GitHub Desktop.
iota in browser seed generate with javascript including testing of distribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const distr = {}; | |
let x = 1000; | |
while(x--) { | |
const nums = Array.from(crypto.getRandomValues(new Uint8Array(65536)).filter(n => n < 27).slice(0, 81)); | |
nums.forEach(n => distr[n] = distr[n] ? distr[n] + 1 : 1); | |
} | |
console.log(distr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment