function generateUserID(len){ var s = ""; for(var i=0; i<len; i++){ var n = Math.floor(Math.random()*61) + 49; if(n > 57+26){ n += 13; }else if(n > 57){ n += 7; } //Asciiコード 48-57, 65-90, 97-122 s += String.fromCharCode(n); } return s; }