Skip to content

Instantly share code, notes, and snippets.

@jimthedev
Created August 23, 2017 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimthedev/c36492c3fb495d86428c0798495c050a to your computer and use it in GitHub Desktop.
Save jimthedev/c36492c3fb495d86428c0798495c050a to your computer and use it in GitHub Desktop.
iota in browser seed generate with javascript including testing of distribution
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