Skip to content

Instantly share code, notes, and snippets.

@pmarreck
Created July 19, 2023 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmarreck/7979454686abcc5d8907e1c11ead5b45 to your computer and use it in GitHub Desktop.
Save pmarreck/7979454686abcc5d8907e1c11ead5b45 to your computer and use it in GitHub Desktop.
Put this as the URL of a browser bookmark and now you have a good password generator.
javascript:(function(){var%20password;var%20regex=/^(?=.*[A-Z].*[A-Z])(?=.*[a-z].*[a-z])(?=.*\d.*\d)(?=.*[!@#$%^&*].*[!@#$%^&*]).{20,}$/;do{password=Array.from(crypto.getRandomValues(new%20Uint32Array(25)),%20x%20=>%20"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"[x%20%%2070]).join('');}while(!regex.test(password));alert(password);})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment