Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function passGen(charsCount) {
- var result = '';
- var words = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
- var max_position = words.length - 1,
- position,
- i;
- for(i = 0; i < charsCount; ++i) {
- position = Math.floor (Math.random() * max_position);
- result = result + words.substring(position, position + 1);
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement