From 71f0d00f8d5d1ee1ee250561367b2953c4fdfdb0 Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Sun, 27 Oct 2019 22:06:38 +0300 Subject: [PATCH] Delete A1Z26CipherEncode.mjs --- src/core/operations/A1Z26CipherEncode.mjs | 61 ----------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/core/operations/A1Z26CipherEncode.mjs diff --git a/src/core/operations/A1Z26CipherEncode.mjs b/src/core/operations/A1Z26CipherEncode.mjs deleted file mode 100644 index fc562b9e..00000000 --- a/src/core/operations/A1Z26CipherEncode.mjs +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @author Jarmo van Lenthe [github.com/jarmovanlenthe] - * @copyright Crown Copyright 2018 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import Utils from "../Utils.mjs"; -import {DELIM_OPTIONS} from "../lib/Delim.mjs"; - -/** - * A1Z26 Cipher Encode operation - */ -class A1Z26CipherEncode extends Operation { - - /** - * A1Z26CipherEncode constructor - */ - constructor() { - super(); - - this.name = "A1Z26 Cipher Encode"; - this.module = "Ciphers"; - this.description = "Converts alphabet characters into their corresponding alphabet order number.

e.g. a becomes 1 and b becomes 2.

Non-alphabet characters are dropped."; - this.infoURL = ""; - this.inputType = "string"; - this.outputType = "string"; - this.args = [ - { - name: "Delimiter", - type: "option", - value: DELIM_OPTIONS - } - ]; - } - - /** - * @param {string} input - * @param {Object[]} args - * @returns {string} - */ - run(input, args) { - const delim = Utils.charRep(args[0] || "Space"); - let output = ""; - - const sanitizedinput = input.toLowerCase(), - charcode = Utils.strToCharcode(sanitizedinput); - - for (let i = 0; i < charcode.length; i++) { - const ordinal = charcode[i] - 96; - - if (ordinal > 0 && ordinal <= 26) { - output += ordinal.toString(10) + delim; - } - } - return output.slice(0, -delim.length); - } - -} - -export default A1Z26CipherEncode;