-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
30 lines (30 loc) · 2.66 KB
/
test.html
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MasterKey Password Generater</title>
<script type="text/javascript" src="src/aes.js"></script>
<script type="text/javascript" src="src/sha512.js"></script>
<script type="text/javascript" src="src/base64.js"></script>
<script type="text/javascript" src="src/masterkey.js"></script>
</head>
<body>
<script type="text/javascript">
document.body.innerText = 'Password Generated for "' + masterkey.parseHostName(location.hostname) + '" :\n' + masterkey.makePassword2(location.hostname, "input your preferred masterKey here inside quotation marks", 16);
var test = {
host: ["", "abc.com.us", "def.com.us", "abc.net.us", "google.con", "google.chk", "github.ms", "github.com", "abc.github.fu"],
result: ["cf83e1357eefb8bd", "6bc4fefcf05445c1", "4e7bcb2dbc42d6d1", "6bc4fefcf05445c1", "b8b6ec7bb539756c", "b8b6ec7bb539756c", "e1d0c0808807551c", "e1d0c0808807551c", "e1d0c0808807551c"],
result2: ["w4Cg8OhNX7Dr8K4w", "a8OEw77DvMOwVEXD", "TnvDiy3CvELDlsOR", "a8OEw77DvMOwVEXD", "wrjCtsOse8K1OXVs", "wrjCtsOse8K1OXVs", "w6HDkMOAwoDCiAdV", "w6HDkMOAwoDCiAdV", "w6HDkMOAwoDCiAdV"]
};
//for (let i=0;i<test.host.length;i++){test.result2.push(masterkey.makePassword2(test.host[i], "input your preferred masterKey here inside quotation marks", 16));}
document.body.innerText += '\n\ntest for makePassword: \n';
for (var i = 0; i < test.host.length; i++) document.body.innerText += test.result[i] == masterkey.makePassword(test.host[i], "input your preferred masterKey here inside quotation marks", 16) ? 'Test ' + (i + 1) + ' passed;\n' : 'Test ' + (i + 1) + ' failed;\n';
document.body.innerText += '\ntest for makePasswordfromShaStr: \n';
for (var i = 0; i < test.host.length; i++) document.body.innerText += test.result[i] == masterkey.makePasswordfromShaStr(test.host[i], "7e48ee26b259c2cdefb663c5a1720562c19f2513f50def2530174fe8fd8b3e8f", 16) ? 'Test ' + (i + 1) + ' passed;\n' : 'Test ' + (i + 1) + ' failed;\n';
document.body.innerText += '\ntest for makePassword2: \n';
for (var i = 0; i < test.host.length; i++) document.body.innerText += test.result2[i] == masterkey.makePassword2(test.host[i], "input your preferred masterKey here inside quotation marks", 16) ? 'Test ' + (i + 1) + ' passed;\n' : 'Test ' + (i + 1) + ' failed;\n';
document.body.innerText += '\ntest for makePassword2fromShaStr: \n';
for (var i = 0; i < test.host.length; i++) document.body.innerText += test.result2[i] == masterkey.makePassword2fromShaStr(test.host[i], "7e48ee26b259c2cdefb663c5a1720562c19f2513f50def2530174fe8fd8b3e8f", 16) ? 'Test ' + (i + 1) + ' passed;\n' : 'Test ' + (i + 1) + ' failed;\n';
</script>
</body>
</html>