-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCalculate_Hex_Passphrase.html
More file actions
32 lines (32 loc) · 928 Bytes
/
Calculate_Hex_Passphrase.html
File metadata and controls
32 lines (32 loc) · 928 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Convert ASCII to Hex</title>
</head>
<body>
<h2>This page converts ASCII to Hexidecimal for MCM pass phrases.</h2>
Enter ASCII string: <input type="text" id="ascii" value="Admin"/>
<br>
<button type="button" id="layouts" onclick="ConvertCommand()">Convert</button>
<div>
<span class="replace"></span>
</div>
<script>
var XMLReq;
var holdReturn=""; ;
function ConvertCommand() {
var ascii = document.getElementById("ascii").value;
var hex = asciiToHex(ascii);
document.getElementsByClassName("replace")[0].innerHTML = "Hex: " + hex;
}
function asciiToHex(str) {
var arr = [];
for (var i = 0, l = str.length; i < l; i ++) {
var hex = Number(str.charCodeAt(i)).toString(16);
arr.push(hex);
}
return arr.join('');
}
</script>
</body>
</html>