Generate random hexadecimal number

function genHex(n) { var output = ''; for (var i = 0; i < n; i++) { output += Math.floor(Math.random()*16).toString(16); } return output; }
Generate random hexadecimal number of n characters by simply calling genHex(n);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.