46 encode(plainText:
string =
"", key:
string =
""):
string {
47 const sanitizedKey = this.sanitize(key);
49 throw new Error(
"Key required");
53 return plainText.split(
"").map(ch => {
62 const shift = Math.floor(keyIndex / 2);
76 decode(cipherText:
string =
"", key:
string =
""):
string {
78 return this.encode(cipherText, key);