- generate random strings with node.js built in crypto lib
const Crypto = require('crypto')
function randomString(size = 21) {
return Crypto
.randomBytes(size)
.toString('base64')
.slice(0, size)
}
console.log(randomString()) // '/VuPgyBlk/aZjPADhMqQk'