Update MultiTapCipherEncode.mjs

Fixed a bug on line 58
This commit is contained in:
Kaustubh BM 2021-05-14 15:36:55 +05:30 committed by GitHub
parent 9c462418e9
commit 431e8494fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,10 +52,10 @@ class MultiTapCipherEncode extends Operation {
if(emap[plaintext.charAt(i)] == undefined) if(emap[plaintext.charAt(i)] == undefined)
throw new OperationError("The input must be only alphabets"); throw new OperationError("The input must be only alphabets");
ciphertext += emap[plaintext.charAt(i)]; ciphertext += emap[plaintext.charAt(i)];
if(i!=plaintext.length) if(i!=plaintext.length-1)
ciphertext += delim; ciphertext += delim;
} }
return ciphertext.substring(0,ciphertext.length-1); return ciphertext.substring(0,ciphertext.length);
} }
} }