Group: User Level:
Posts: 274 Joined: 9/20/2020 IP-Address: saved
|
const mac = ""+serial-number+""; document.getElementById("default-password").textContent = "The password is: " + gerador(mac); // output the generated key
function gerador(mac) { let key = "XXXXXXXXXXXXXXXXXXXX"; for (let i = 0; i < mac.length; i++) { switch (i) { case 0: key = setCharAt(key, 1, dicionario(mac.charAt(i))); break; case 1: key = setCharAt(key, 3, dicionario(mac.charAt(i))); key = setCharAt(key, 12, dicionario(mac.charAt(i))); break; case 2: key = setCharAt(key, 5, dicionario(mac.charAt(i))); key = setCharAt(key, 17, dicionario(mac.charAt(i))); break; case 3: key = setCharAt(key, 7, dicionario(mac.charAt(i))); break; case 4: key = setCharAt(key, 9, dicionario(mac.charAt(i))); key = setCharAt(key, 18, dicionario(mac.charAt(i))); break; case 5: key = setCharAt(key, 11, dicionario(mac.charAt(i))); break; case 6: key = setCharAt(key, 10, dicionario(mac.charAt(i))); key = setCharAt(key, 13, dicionario(mac.charAt(i))); break; case 7: key = setCharAt(key, 8, dicionario(mac.charAt(i))); break; case 8: key = setCharAt(key, 6, dicionario(mac.charAt(i))); key = setCharAt(key, 14, dicionario(mac.charAt(i))); break; case 9: key = setCharAt(key, 15, dicionario(mac.charAt(i))); key = setCharAt(key, 4, dicionario(mac.charAt(i))); break; case 10: key = setCharAt(key, 2, dicionario(mac.charAt(i))); key = setCharAt(key, 19, dicionario(mac.charAt(i))); break; case 11: key = setCharAt(key, 0, dicionario(mac.charAt(i))); key = setCharAt(key, 16, dicionario(mac.charAt(i))); break; } } return key; }
function dicionario(letra) { letra = letra.toUpperCase(); switch (letra) { case "1": return "r"; break; case "2": return "q"; break; case "3": return "a"; break; case "4": return "H"; break; case "5": return "N"; break; case "6": return "p"; break; case "7": return "d"; break; case "8": return "S"; break; case "9": return "Y"; break; case "0": return "X"; break; case "A": return "w"; break; case "B": return "8"; break; case "C": return "6"; break; case "D": return "2"; break; case "E": return "1"; break; case "F": return "5"; break; default: return }
|