mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
update
This commit is contained in:
parent
ae37a7a6eb
commit
201b181a64
@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Copies the text from the output
|
//Copies the text from the output
|
||||||
function docopy() {
|
function docopy() {
|
||||||
document.getElementById("output").select();
|
document.getElementById("output").select();
|
||||||
@ -9,13 +6,17 @@ function docopy() {
|
|||||||
|
|
||||||
function doencode() {
|
function doencode() {
|
||||||
var inputData = document.getElementById("input").value;
|
var inputData = document.getElementById("input").value;
|
||||||
var outputdata = rot13(inputData);
|
var outputdataP1 = rot13(inputData);
|
||||||
|
var outputdataP2 = base64Encode(outputdataP1);
|
||||||
|
var outputdata = outputdataP2;
|
||||||
document.getElementById("output").value = outputdata;
|
document.getElementById("output").value = outputdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dodecode() {
|
function dodecode() {
|
||||||
var inputData = document.getElementById("input").value;
|
var inputData = document.getElementById("input").value;
|
||||||
var outputdata = rot13(inputData);
|
var outputdataP1 = rot13(inputData);
|
||||||
|
var outputdataP2 = base64Decode(outputdataP1);
|
||||||
|
var outputdata = outputdataP2;
|
||||||
document.getElementById("output").value = outputdata;
|
document.getElementById("output").value = outputdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,3 +24,11 @@ function dodecode() {
|
|||||||
function rot13(message) {
|
function rot13(message) {
|
||||||
return message.replace(/[a-z]/gi, letter => String.fromCharCode(letter.charCodeAt(0) + (letter.toLowerCase() <= 'm' ? 13 : -13)));
|
return message.replace(/[a-z]/gi, letter => String.fromCharCode(letter.charCodeAt(0) + (letter.toLowerCase() <= 'm' ? 13 : -13)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function base64Encode(message) {
|
||||||
|
return btoa(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64Decode(message) {
|
||||||
|
return atob(message);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user