Skip to content

Instantly share code, notes, and snippets.

@maestrow
Last active June 15, 2020 16:38
Show Gist options
  • Save maestrow/cfe6182862481e54e3640e76d0959063 to your computer and use it in GitHub Desktop.
Save maestrow/cfe6182862481e54e3640e76d0959063 to your computer and use it in GitHub Desktop.
Passsword generator bookmarklet (javascript)
javascript:(function() {
var lowers = 'abcdefghijklmnopqrstuvwxyz';
var uppers = lowers.toUpperCase();
var nums = '123456789';
var alphabeet = lowers + uppers + nums;
var pass = '';
for (var i = 0; i<8; i++) {
var x = Math.floor(Math.random() * alphabeet.length);
pass += alphabeet[x];
}
prompt('Password: ', pass);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment