const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; function randomChar() { return ALPHABET.charAt(Math.floor(Math.random()*62)) } function createHash(len) { var str = ''; while(str.length < len) str += randomChar(); return str; } module.exports = createHash;