spelling: necessary
This commit is contained in:
parent
14fd0f8fcf
commit
213c99e14b
@ -55,7 +55,7 @@ class VigenèreDecode extends Operation {
|
|||||||
keyIndex = alphabet.indexOf(chr);
|
keyIndex = alphabet.indexOf(chr);
|
||||||
msgIndex = alphabet.indexOf(input[i]);
|
msgIndex = alphabet.indexOf(input[i]);
|
||||||
// Subtract indexes from each other, add 26 just in case the value is negative,
|
// Subtract indexes from each other, add 26 just in case the value is negative,
|
||||||
// modulo to remove if neccessary
|
// modulo to remove if necessary
|
||||||
output += alphabet[(msgIndex - keyIndex + alphabet.length) % 26];
|
output += alphabet[(msgIndex - keyIndex + alphabet.length) % 26];
|
||||||
} else if (alphabet.indexOf(input[i].toLowerCase()) >= 0) {
|
} else if (alphabet.indexOf(input[i].toLowerCase()) >= 0) {
|
||||||
chr = key[(i - fail) % key.length].toLowerCase();
|
chr = key[(i - fail) % key.length].toLowerCase();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user