Created
September 30, 2014 00:59
-
-
Save kaievns/2fb484feb3e55c1ac439 to your computer and use it in GitHub Desktop.
Random hex of arbitrary size in javascript
This file contains hidden or 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
function random_hex(size) { | |
return Array.apply(null, Array(size)).map(function() { | |
return (Math.random()*16|0).toString(16); | |
}).join(""); | |
} | |
console.log(random_hex(128)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment