From 9158c7afedf3c368d7383492b50471d861ae05d7 Mon Sep 17 00:00:00 2001 From: Abhiraj Singh <85307790+Stickpillow93@users.noreply.github.com> Date: Tue, 29 Mar 2022 13:34:23 +0530 Subject: [PATCH] Add files via upload --- script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index f35880c..84b218c 100644 --- a/script.js +++ b/script.js @@ -60,6 +60,7 @@ let dict2 = { k: "y", " ": " ", }; + function chars(string) { return Array.from(String(string)); } @@ -68,7 +69,7 @@ function encrypt() { alert("enter some text"); } let output_string = ""; - bruh = chars(x.value); + bruh = chars(x.value.toLowerCase()); for (let i = 0, size = bruh.length; i < size; i++) { if (dict[bruh[i]] != undefined) { bruh[i] = dict[bruh[i]]; @@ -85,7 +86,7 @@ function encrypt() { function decrypt() { let output_string = ""; - bruh = chars(x.value); + bruh = chars(x.value.toLowerCase()); for (let i = 0, size = bruh.length; i < size; i++) { if (dict2[bruh[i]] != undefined) { bruh[i] = dict2[bruh[i]];