Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i, tmp, len = 20, pass = "";
- function charGen() {
- return String.fromCharCode(Math.floor(Math.random() * (0x5a - 0x41) + 0x41));
- };
- function numGen() {
- return String.fromCharCode(Math.floor(Math.random() * (0x39 - 0x30) + 0x30));
- };
- function SymbGen() {
- return String.fromCharCode(Math.floor(Math.random() * (0x2f - 0x21) + 0x21));
- };
- for (i = 0; i < len; i++) {
- tmp = Math.floor(Math.random() * (5 - 1) + 1);
- switch(tmp){
- case 1:
- pass += charGen();
- break;
- case 2:
- pass += numGen();
- break;
- case 3:
- pass += SymbGen();
- break;
- };
- };
- <input type="checkbox" class="checkboxes" name="genMethod">
- <span>Number</span><br>
- <input type="checkbox" class="checkboxes" name="genMethod">
- <span>Symbols</span><br>
- <input type="checkbox" class="checkboxes" name="genMethod">
- <span>Chars</span><br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement