Created
May 3, 2023 04:02
-
-
Save moxet/f3910e2bcdde57ae696fdf6447a0888c to your computer and use it in GitHub Desktop.
Random Password Generator for Wordpress Jquery JFB
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
<script> | |
jQuery(document).ready(function($) { | |
var generatePassword = ( | |
length = 20, | |
wishlist = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$' | |
) => | |
Array.from(crypto.getRandomValues(new Uint32Array(length))) | |
.map((x) => wishlist[x % wishlist.length]) | |
.join('') | |
$(".user_password").val(generatePassword()); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment