generate random string in nodejs code example
Example 1: random string js
const string_length = 10
[...Array(string_length)].map(i=>(~~(Math.random()*36)).toString(36)).join('')
Example 2: how to generate random string in node js
var crypto = require("crypto");
var id = crypto.randomBytes(20).toString('hex');
// "bb5dc8842ca31d4603d6aa11448d1654"