kapott

random_password_01.js

Jan 3rd, 2019
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.     Code golf: Password generator
  3.     Constraints: 16characters, letters and numbers only
  4.  
  5.     Note: Just copy-paste the snippet below in your browser console, and it'll give you an alphanumerical 16-char password. This golf is actually quite readable imo.
  6.  
  7.     l = password length
  8.     c = charset for the password
  9.  
  10.   2019-01-04 : 139chr
  11. */
  12. l=16;c="abcdefgijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(i=0,n=c.length,s="";i<=l;i+=1){s+=c.charAt((Math.random()*n)|0)}
Add Comment
Please, Sign In to add comment