-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
27 lines (27 loc) · 822 Bytes
/
index.html
File metadata and controls
27 lines (27 loc) · 822 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
<!DOCTYPE html>
<html>
<head>
<title>The Encoder</title>
</head>
<body>
<p>Normal text here</p>
<textarea id = "raw" cols = "50" rows = "4" onchange = "encode()"></textarea>
<br>
<p>Layers of encryption</p>
<input id = "iter" type = "number" min = "1" max = "9" value = "3" onchange = "encode()">
<br>
<p>Encoded text here</p>
<textarea id = "encoded" cols = "50" rows = "15" readonly></textarea>
<script>
var outputStr = "";
function encode () {
outputStr = document.getElementById("raw").value;
for (var i = 1; i < parseInt(document.getElementById("iter").value); i++) {
outputStr = btoa(outputStr);
}
outputStr += document.getElementById("iter").value;
outputStr = btoa(outputStr)
document.getElementById("encoded").value = outputStr;
}
</script>
</body>