-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHexdedit.html
54 lines (50 loc) · 1.56 KB
/
Hexdedit.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<title>Hexdedit</title>
<style>
html {
padding: 5%;
color: #EEE;
font-family: Courier New;
font-size: 20px
}
body {
background: #222;
}
</style>
</head>
<body>
<h1>Hexdedit V0.1a</h1>
<button id="trigger">Process</button>
<h2>Input</h2>
<textarea style="width: 80vw; height: 80vh" id="input"></textarea>
<h2>Output</h2>
<textarea style="width: 80vw; height: 80vh" id="output"></textarea>
<footer>Copyright 2024 Pacifiky. All rights reserved.</footer>
<script>
let inp = document.getElementById("input");
let trig = document.getElementById("trigger");
let out = document.getElementById("output");
trig.addEventListener("click", (e) => {
let splittext = inp.value;
splittext = splittext.split(",");
let outputtext = "";
for (let i = 0; i <= parseInt(splittext.length / 8); i++) {
let ri = i * 8;
let rowtext = ri.toString(16);
for (let j = 0; j < 8; j++) {
if (ri + j >= splittext.length) {
break;
};
rowtext += ' ' + splittext[ri + j];
if (j == 3) { rowtext += " |" };
};
outputtext += rowtext + "\n";
};
out.value = outputtext;
return;
});
</script>
</body>
</html>