Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function randomString(length = 16) {
- const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/';
- const charCount = chars.length;
- let str = '';
- while (length-- > 0) {
- str += chars[Math.floor(Math.random() * charCount)];
- }
- return str;
- }
Add Comment
Please, Sign In to add comment