Advertisement
Guest User

Untitled

a guest
Jul 20th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function passGen(charsCount) {
  2. var result = '';
  3. var words = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
  4. var max_position = words.length - 1,
  5. position,
  6. i;
  7. for(i = 0; i < charsCount; ++i) {
  8. position = Math.floor (Math.random() * max_position);
  9. result = result + words.substring(position, position + 1);
  10. }
  11. return result;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement