Created
March 11, 2015 09:48
-
-
Save dylansmith/070c5183434c76ae9b18 to your computer and use it in GitHub Desktop.
Bookmarklet to generate a random password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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