Packages
A web application in pursuit of meaning in life.
Retired package: Complete rewrite, scratch old versions
Current section
Files
Jump to
Current section
Files
assets/node_modules/mout/random/randHex.js
var choice = require('./choice');
var _chars = '0123456789abcdef'.split('');
/**
* Returns a random hexadecimal string
*/
function randHex(size){
size = size && size > 0? size : 6;
var str = '';
while (size--) {
str += choice(_chars);
}
return str;
}
module.exports = randHex;