From f0b01f1e58046e8b0b0ec5aa4460fd43f49035cb Mon Sep 17 00:00:00 2001 From: Boof <97455552+hexahigh@users.noreply.github.com> Date: Mon, 17 Apr 2023 11:12:44 +0200 Subject: [PATCH] test --- tools/encoder/index.html | 20 ++++++++++++++++++++ tools/encoder/index.js | 25 +++++++++++++++++++++++++ tools/encoder/style.css | 0 3 files changed, 45 insertions(+) create mode 100644 tools/encoder/index.html create mode 100644 tools/encoder/index.js create mode 100644 tools/encoder/style.css diff --git a/tools/encoder/index.html b/tools/encoder/index.html new file mode 100644 index 0000000..cc6756e --- /dev/null +++ b/tools/encoder/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + +
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/tools/encoder/index.js b/tools/encoder/index.js new file mode 100644 index 0000000..1fc413e --- /dev/null +++ b/tools/encoder/index.js @@ -0,0 +1,25 @@ + + + +//Copies the text from the output +function docopy() { + document.getElementById("output").select(); + document.execCommand('copy'); +} + +function doencode() { + var inputData = document.getElementById("input").value; + var outputdata = rot13(inputData); + document.getElementById("output").value = outputdata; +} + +function dodecode() { + var inputData = document.getElementById("input").value; + var outputdata = rot13(inputData); + document.getElementById("output").value = outputdata; +} + +//Rot13 cipher +function rot13(message) { + return message.replace(/[a-z]/gi, letter => String.fromCharCode(letter.charCodeAt(0) + (letter.toLowerCase() <= 'm' ? 13 : -13))); +} diff --git a/tools/encoder/style.css b/tools/encoder/style.css new file mode 100644 index 0000000..e69de29