You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this.description="Converts alphabet order numbers into their corresponding alphabet character.<br><br>e.g. <code>1</code> becomes <code>a</code> and <code>2</code> becomes <code>b</code>.";
26
+
this.infoURL="";
27
+
this.inputType="string";
28
+
this.outputType="string";
29
+
this.args=[
30
+
{
31
+
name: "Delimiter",
32
+
type: "option",
33
+
value: DELIM_OPTIONS
34
+
}
35
+
];
36
+
}
37
+
38
+
/**
39
+
* @param {string} input
40
+
* @param {Object[]} args
41
+
* @returns {string}
42
+
*/
43
+
run(input,args){
44
+
constdelim=Utils.charRep(args[0]||"Space");
45
+
46
+
if(input.length===0){
47
+
return[];
48
+
}
49
+
50
+
letbites=input.split(delim),
51
+
latin1="";
52
+
for(leti=0;i<bites.length;i++){
53
+
if(bites[i]<1||bites[i]>26){
54
+
thrownewOperationError("Error: all numbers must be between 1 and 26.");
* @author Jarmo van Lenthe [github.com/jarmovanlenthe]
3
+
* @copyright Crown Copyright 2018
4
+
* @license Apache-2.0
5
+
*/
6
+
7
+
importOperationfrom"../Operation";
8
+
importUtilsfrom"../Utils";
9
+
import{DELIM_OPTIONS}from"../lib/Delim";
10
+
11
+
/**
12
+
* A1Z26 Cipher Encode operation
13
+
*/
14
+
classA1Z26CipherEncodeextendsOperation{
15
+
16
+
/**
17
+
* A1Z26CipherEncode constructor
18
+
*/
19
+
constructor(){
20
+
super();
21
+
22
+
this.name="A1Z26 Cipher Encode";
23
+
this.module="Ciphers";
24
+
this.description="Converts alphabet characters into their corresponding alphabet order number.<br><br>e.g. <code>a</code> becomes <code>1</code> and <code>b</code> becomes <code>2</code>.<br><br>Non-alphabet characters are dropped.";
0 commit comments