let charBig = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
let charSm = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
function randomChar(len, type){
let cs = [];
switch(type){
case 'A':
cs = charBig;
break;
case 'a':
cs = charSm;
break;
default:
cs = [...charBig,...charSm];
}
let str = '';
for(let i=0;i<len;i++){
let idx = parseInt(Math.random() * cs.length)
str += cs[idx]
}
return str;
}