Skip to content

Instantly share code, notes, and snippets.

@dylansmith
Created March 11, 2015 09:48
Show Gist options
  • Save dylansmith/070c5183434c76ae9b18 to your computer and use it in GitHub Desktop.
Save dylansmith/070c5183434c76ae9b18 to your computer and use it in GitHub Desktop.
Bookmarklet to generate a random password
(function() {
var url = 'https://www.random.org/passwords/?num=1&len=$1&format=plain&rnd=new', xhr = new XMLHttpRequest(), len, req, output;
len = window.prompt('How many characters?', 15);
url = url.replace('$1', len);
xhr.onload = function() { prompt('Here\'s your password', this.responseText); };
xhr.open('get', url, true);
xhr.send();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment