UNPKG

@helios-chain-labs/helios-cli

Version:
7 lines (6 loc) 280 B
function randomString(length = 32, chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') { var result = ''; for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]; return result; } module.exports = randomString;