Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
multiverseweb authored May 20, 2024
1 parent 103f16a commit 571c6ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let key = 4; //

function encryptText() {
const text = document.getElementById("inputText").value;
const cycles = parseInt(document.getElementById("cycles").value) || 1; // Use default value of 1 if cycles is not a valid number
const cycles = parseInt(document.getElementById("cycles").value) || 4; // Use default value of 1 if cycles is not a valid number

if (!text || isNaN(cycles) || cycles <= 0) {
alert("Please enter some text and a valid number of cycles.");
Expand All @@ -19,7 +19,7 @@ function encryptText() {

function decryptText() {
const coded = document.getElementById("inputText").value;
const cycles = parseInt(document.getElementById("cycles").value) || 1; // Use default value of 1 if cycles is not a valid number
const cycles = parseInt(document.getElementById("cycles").value) || 4; // Use default value of 1 if cycles is not a valid number

if (!coded || isNaN(cycles) || cycles <= 0) {
alert("Please enter some text and a valid number of cycles.");
Expand Down

0 comments on commit 571c6ff

Please sign in to comment.