Used regex to change block format

This commit is contained in:
Tim Stallard 2017-03-13 12:41:56 +00:00
parent 2bedbea8a7
commit eb26bea14e
20 changed files with 217 additions and 38 deletions

View File

@ -1,9 +1,24 @@
module.exports = { module.exports = {
name: "Affine Decrypt", name: "Affine Decrypt",
inputs: { inputs: {
text: "Text", text: {
a: "a", name: "Text",
b: "b" type: "text",
required: true,
inline: false
},
a: {
name: "a",
type: "text",
required: true,
inline: false
},
b: {
name: "b",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({text, a, b}, elem){ execute: function({text, a, b}, elem){

View File

@ -1,9 +1,24 @@
module.exports = { module.exports = {
name: "Affine Encrypt", name: "Affine Encrypt",
inputs: { inputs: {
text: "Text", text: {
a: "a", name: "Text",
b: "b" type: "text",
required: true,
inline: false
},
a: {
name: "a",
type: "text",
required: true,
inline: false
},
b: {
name: "b",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({text, a, b}, elem){ execute: function({text, a, b}, elem){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "ASCII to Hex", name: "ASCII to Hex",
inputs: { inputs: {
text: "Text" text: {
name: "Text",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({text}, elem){ execute: function({text}, elem){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "Atbash", name: "Atbash",
inputs: { inputs: {
text: "Text" text: {
name: "Text",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({text}, elem){ execute: function({text}, elem){

View File

@ -2,12 +2,16 @@ module.exports = {
name: "Caesar", name: "Caesar",
inputs: { inputs: {
text: { text: {
name: "Text" name: "Text",
type: "text",
required: true,
inline: false
}, },
shift: { shift: {
name: "Shift", name: "Shift",
inline: true, type: "number",
type: "number" required: true,
inline: true
} }
}, },
output: true, output: true,

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Concat", name: "Concat",
inputs: { inputs: {
str1: "String 1", str1: {
str2: "String 2" name: "String 1",
type: "text",
required: true,
inline: false
},
str2: {
name: "String 2",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({str1, str2}, block){ execute: function({str1, str2}, block){

View File

@ -3,11 +3,36 @@ var events = require("../events.js");
module.exports = { module.exports = {
name: "Custom Code", name: "Custom Code",
inputs: { inputs: {
inp1: "1", inp1: {
inp2: "2", name: "1",
inp3: "3", type: "text",
inp4: "4", required: true,
inp5: "5" inline: false
},
inp2: {
name: "2",
type: "text",
required: true,
inline: false
},
inp3: {
name: "3",
type: "text",
required: true,
inline: false
},
inp4: {
name: "4",
type: "text",
required: true,
inline: false
},
inp5: {
name: "5",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function(inputs, block){ execute: function(inputs, block){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "Elements to Numbers", name: "Elements to Numbers",
inputs: { inputs: {
elements: "Elements" elements: {
name: "Elements",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({elements}, elem){ execute: function({elements}, elem){

View File

@ -50,7 +50,12 @@ function topGroupsByFrequency(groups, alreadyPercentage){
module.exports = { module.exports = {
name: "Frequency Analysis", name: "Frequency Analysis",
inputs: { inputs: {
input: "Input" input: {
name: "Input",
type: "text",
required: true,
inline: false
}
}, },
output: false, output: false,
execute: function({input}, block){ execute: function({input}, block){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "Hex to ASCII", name: "Hex to ASCII",
inputs: { inputs: {
hex: "Hex String" hex: {
name: "Hex String",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({hex}, elem){ execute: function({hex}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Letters to Numbers", name: "Letters to Numbers",
inputs: { inputs: {
letters: "Letters", letters: {
offset: "Offset" name: "Letters",
type: "text",
required: true,
inline: false
},
offset: {
name: "Offset",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({letters, offset}, elem){ execute: function({letters, offset}, elem){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "Numbers to Elements", name: "Numbers to Elements",
inputs: { inputs: {
numbers: "Numbers" numbers: {
name: "Numbers",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({numbers}, elem){ execute: function({numbers}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Numbers to Letters", name: "Numbers to Letters",
inputs: { inputs: {
nums: "Numbers", nums: {
offset: "Offset" name: "Numbers",
type: "text",
required: true,
inline: false
},
offset: {
name: "Offset",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({nums, offset}, elem){ execute: function({nums, offset}, elem){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "Reverse", name: "Reverse",
inputs: { inputs: {
input: "Input" input: {
name: "Input",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({input}, elem){ execute: function({input}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Substitution", name: "Substitution",
inputs: { inputs: {
text: "Text", text: {
mapping: "Mapping" name: "Text",
type: "text",
required: true,
inline: false
},
mapping: {
name: "Mapping",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({text, mapping}, elem){ execute: function({text, mapping}, elem){

View File

@ -1,7 +1,12 @@
module.exports = { module.exports = {
name: "Example Block", name: "Example Block",
inputs: { inputs: {
input: "Input" input: {
name: "Input",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({input}, elem){ execute: function({input}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Transposition", name: "Transposition",
inputs: { inputs: {
text: "Text", text: {
n: "n" name: "Text",
type: "text",
required: true,
inline: false
},
n: {
name: "n",
type: "number",
required: true,
inline: true
}
}, },
output: true, output: true,
execute: function({text, n}, elem){ execute: function({text, n}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Transposition Reverse", name: "Transposition Reverse",
inputs: { inputs: {
text: "Text", text: {
n: "n" name: "Text",
type: "text",
required: true,
inline: false
},
n: {
name: "n",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({text, n}, elem){ execute: function({text, n}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Vigenere Decode", name: "Vigenere Decode",
inputs: { inputs: {
cipherText: "Ciphertext", cipherText: {
key: "Key" name: "Ciphertext",
type: "text",
required: true,
inline: false
},
key: {
name: "Key",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({cipherText, key}, elem){ execute: function({cipherText, key}, elem){

View File

@ -1,8 +1,18 @@
module.exports = { module.exports = {
name: "Vigenere Encode", name: "Vigenere Encode",
inputs: { inputs: {
plaintext: "Plaintext", plaintext: {
key: "Key" name: "Plaintext",
type: "text",
required: true,
inline: false
},
key: {
name: "Key",
type: "text",
required: true,
inline: false
}
}, },
output: true, output: true,
execute: function({plaintext, key}, elem){ execute: function({plaintext, key}, elem){