I created password generator where you can create random password.
What you can do
- Create multi passwords at once.
- Create password with special characters (!#$%&\'(){}[]”;:@^_-).
Code (JavaScript part)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
function getPassword() { var length = document.getElementById("digits").value; if (!length.match(/^[1-9][0-9]*$/)) { document.getElementById("result").value = "桁数を正しく入力してください。"; return; } var count = document.getElementById("count").value; if (!count.match(/^[1-9][0-9]*$/)) { document.getElementById("result").value = "個数を正しく入力してください。"; return; } var len = parseInt(length); var cnt = parseInt(count); var complexRadios = document.getElementsByName("complex"); var complex; for (var i = 0; i < complexRadios.length; i++) { if (complexRadios[i].checked) { complex = i; } } var seed1 = '01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; var seed2 = '!#$%&\'(){}[]";:@^_-'; var seed = ''; seed = (complex == 0) ? seed1 + seed2 : seed1; var pwd = '', pwds = ''; var i = 0, j = 0; for (i = 0; i < cnt; i++) { pwd = ''; for (j = 0; j < len; j++) { pwd += seed[Math.floor(Math.random() * seed.length)]; } pwds += pwd + "\n"; } document.getElementById("result").value = pwds; } |