Skip to content

Commit e0fa99b

Browse files
authored
Update keyFinder.js
optimized the indentation for the if statement in line 18
1 parent 5a75bca commit e0fa99b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Ciphers/keyFinder.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ function keyFinder(){
1010
var str = document.getElementById("encryptedID").value; //get the input string
1111
var inStr = str.toString(); //convert the input to String
1212
var outStr = ""; // store the output value
13-
document.getElementById("debug").innerHTML = shiftNum;
13+
document.getElementById("debug").innerHTML = shiftNum; // debug: display the shifted number(s)
1414
for (var i=0; i<26; i++){
1515
outStr = caesarCipherEncodeAndDecodeEngine(inStr,i); // use the encrytpion engine to decrypt the input string, shiftNum=i
1616
for ( var i=0; i<wordbank.length; i++){
1717
if (wordbank[i] == outStr[i]+outStr[i+1]{
18-
key=i;
19-
}
18+
key=i;
19+
}
2020
}
21-
}
22-
return key;
21+
}
22+
return key;
2323
}

0 commit comments

Comments
 (0)