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