Something like this? And then change length and possible to the desired rng length and complexity.
function rng(){
let uID = '';
let length = 8;
let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < length; i++) {
uID += possible.charAt(Math.floor(Math.random() * possible.length));
}
return uID;
}