1function randomString(length, chars) {
2 var result = '';
3 for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
4 return result;
5}
6var rString = randomString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');