This commit is contained in:
@@ -15,13 +15,12 @@ async function encrypt() {
|
||||
}
|
||||
|
||||
async function decrypt() {
|
||||
const ciphertext = document.getElementById("ciphertext").value;
|
||||
|
||||
if (!ciphertext) return alert("Nessun testo da decifrare!");
|
||||
const c = document.getElementById("ciphertext").value;
|
||||
if (!c) return alert("Nessun testo da decifrare!");
|
||||
try {
|
||||
const res = await fetch("/seal/caesar/decrypt", {
|
||||
method: "POST", headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ ciphertext: ciphertext })
|
||||
body: JSON.stringify({ ciphertext: c })
|
||||
});
|
||||
const data = await res.json();
|
||||
document.getElementById("decodedtext").value = JSON.stringify(data, null, 2);
|
||||
|
||||
Reference in New Issue
Block a user