Last active
May 15, 2018 02:02
-
-
Save infinnie/25c450d4fc2d9726cade514aeef389c3 to your computer and use it in GitHub Desktop.
JavaScript generate something random
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
[...crypto.getRandomValues(new Uint8Array(8))].map(function (x) { | |
var t = x.toString(16); | |
return t.length === 2 ? t : "0" + t; | |
}).join(""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment