mirror of
https://github.com/gchq/CyberChef.git
synced 2025-07-01 18:32:26 -04:00
adding prettier
This commit is contained in:
parent
c5a1b69c30
commit
ab0bc52d3c
717 changed files with 29324 additions and 18602 deletions
|
@ -11,10 +11,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import {
|
||||
setLongTestFailure,
|
||||
logTestReport,
|
||||
} from "../lib/utils.mjs";
|
||||
import { setLongTestFailure, logTestReport } from "../lib/utils.mjs";
|
||||
|
||||
import TestRegister from "../lib/TestRegister.mjs";
|
||||
import "./tests/AESKeyWrap.mjs";
|
||||
|
@ -147,7 +144,7 @@ import "./tests/YARA.mjs";
|
|||
const testStatus = {
|
||||
allTestsPassing: true,
|
||||
counts: {
|
||||
total: 0,
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -155,7 +152,7 @@ setLongTestFailure();
|
|||
|
||||
const logOpsTestReport = logTestReport.bind(null, testStatus);
|
||||
|
||||
(async function() {
|
||||
(async function () {
|
||||
const results = await TestRegister.runTests();
|
||||
logOpsTestReport(results);
|
||||
})();
|
||||
|
|
|
@ -14,12 +14,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: RFC Test Vector, 128-bit data, 192-bit KEK",
|
||||
|
@ -29,12 +30,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: RFC Test Vector, 128-bit data, 256-bit KEK",
|
||||
|
@ -44,12 +46,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: RFC Test Vector, 192-bit data, 192-bit KEK",
|
||||
|
@ -59,12 +62,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: RFC Test Vector, 192-bit data, 256-bit KEK",
|
||||
|
@ -74,12 +78,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: RFC Test Vector, 256-bit data, 256-bit KEK",
|
||||
|
@ -89,12 +94,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: RFC Test Vector, 128-bit data, 128-bit KEK",
|
||||
|
@ -104,12 +110,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: RFC Test Vector, 128-bit data, 192-bit KEK",
|
||||
|
@ -119,12 +126,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: RFC Test Vector, 128-bit data, 256-bit KEK",
|
||||
|
@ -134,12 +142,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: RFC Test Vector, 192-bit data, 192-bit KEK",
|
||||
|
@ -149,12 +158,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f1011121314151617" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: RFC Test Vector, 192-bit data, 256-bit KEK",
|
||||
|
@ -164,12 +174,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: RFC Test Vector, 256-bit data, 256-bit KEK",
|
||||
|
@ -179,12 +190,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: invalid KEK length",
|
||||
|
@ -194,12 +206,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00010203040506070809"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "00010203040506070809" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: invalid IV length",
|
||||
|
@ -209,12 +222,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: input length not multiple of 8",
|
||||
|
@ -224,12 +238,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Wrap: input too short",
|
||||
|
@ -239,12 +254,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Wrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: invalid KEK length",
|
||||
|
@ -254,12 +270,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00010203040506070809"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "00010203040506070809" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: invalid IV length",
|
||||
|
@ -269,12 +286,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: input length not multiple of 8",
|
||||
|
@ -284,12 +302,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: input too short",
|
||||
|
@ -299,12 +318,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AES Key Unwrap: corrupted input",
|
||||
|
@ -314,11 +334,12 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "AES Key Unwrap",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c0d0e0f"},
|
||||
{"option": "Hex", "string": "a6a6a6a6a6a6a6a6"},
|
||||
"Hex", "Hex"
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c0d0e0f" },
|
||||
{ "option": "Hex", "string": "a6a6a6a6a6a6a6a6" },
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -18,7 +18,7 @@ TestRegister.addTests([
|
|||
op: "Avro to JSON",
|
||||
args: [true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Avro to JSON: no input (force JSON false)",
|
||||
|
@ -29,38 +29,40 @@ TestRegister.addTests([
|
|||
op: "Avro to JSON",
|
||||
args: [false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Avro to JSON: small (force JSON true)",
|
||||
input: "\x4f\x62\x6a\x01\x04\x16\x61\x76\x72\x6f\x2e\x73\x63\x68\x65\x6d\x61\x96\x01\x7b\x22\x74\x79\x70\x65\x22\x3a\x22\x72\x65" +
|
||||
"\x63\x6f\x72\x64\x22\x2c\x22\x6e\x61\x6d\x65\x22\x3a\x22\x73\x6d\x61\x6c\x6c\x22\x2c\x22\x66\x69\x65\x6c\x64\x73\x22\x3a" +
|
||||
"\x5b\x7b\x22\x6e\x61\x6d\x65\x22\x3a\x22\x6e\x61\x6d\x65\x22\x2c\x22\x74\x79\x70\x65\x22\x3a\x22\x73\x74\x72\x69\x6e\x67" +
|
||||
"\x22\x7d\x5d\x7d\x14\x61\x76\x72\x6f\x2e\x63\x6f\x64\x65\x63\x08\x6e\x75\x6c\x6c\x00\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7" +
|
||||
"\x5c\xda\xb9\xa6\x2f\x15\x41\x02\x0e\x0c\x6d\x79\x6e\x61\x6d\x65\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7\x5c\xda\xb9\xa6\x2f" +
|
||||
"\x15\x41",
|
||||
expectedOutput: "{\n \"name\": \"myname\"\n}",
|
||||
input:
|
||||
"\x4f\x62\x6a\x01\x04\x16\x61\x76\x72\x6f\x2e\x73\x63\x68\x65\x6d\x61\x96\x01\x7b\x22\x74\x79\x70\x65\x22\x3a\x22\x72\x65"
|
||||
+ "\x63\x6f\x72\x64\x22\x2c\x22\x6e\x61\x6d\x65\x22\x3a\x22\x73\x6d\x61\x6c\x6c\x22\x2c\x22\x66\x69\x65\x6c\x64\x73\x22\x3a"
|
||||
+ "\x5b\x7b\x22\x6e\x61\x6d\x65\x22\x3a\x22\x6e\x61\x6d\x65\x22\x2c\x22\x74\x79\x70\x65\x22\x3a\x22\x73\x74\x72\x69\x6e\x67"
|
||||
+ "\x22\x7d\x5d\x7d\x14\x61\x76\x72\x6f\x2e\x63\x6f\x64\x65\x63\x08\x6e\x75\x6c\x6c\x00\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7"
|
||||
+ "\x5c\xda\xb9\xa6\x2f\x15\x41\x02\x0e\x0c\x6d\x79\x6e\x61\x6d\x65\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7\x5c\xda\xb9\xa6\x2f"
|
||||
+ "\x15\x41",
|
||||
expectedOutput: '{\n "name": "myname"\n}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Avro to JSON",
|
||||
args: [true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Avro to JSON: small (force JSON false)",
|
||||
input: "\x4f\x62\x6a\x01\x04\x16\x61\x76\x72\x6f\x2e\x73\x63\x68\x65\x6d\x61\x96\x01\x7b\x22\x74\x79\x70\x65\x22\x3a\x22\x72\x65" +
|
||||
"\x63\x6f\x72\x64\x22\x2c\x22\x6e\x61\x6d\x65\x22\x3a\x22\x73\x6d\x61\x6c\x6c\x22\x2c\x22\x66\x69\x65\x6c\x64\x73\x22\x3a" +
|
||||
"\x5b\x7b\x22\x6e\x61\x6d\x65\x22\x3a\x22\x6e\x61\x6d\x65\x22\x2c\x22\x74\x79\x70\x65\x22\x3a\x22\x73\x74\x72\x69\x6e\x67" +
|
||||
"\x22\x7d\x5d\x7d\x14\x61\x76\x72\x6f\x2e\x63\x6f\x64\x65\x63\x08\x6e\x75\x6c\x6c\x00\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7" +
|
||||
"\x5c\xda\xb9\xa6\x2f\x15\x41\x02\x0e\x0c\x6d\x79\x6e\x61\x6d\x65\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7\x5c\xda\xb9\xa6\x2f" +
|
||||
"\x15\x41",
|
||||
expectedOutput: "{\"name\":\"myname\"}\n",
|
||||
input:
|
||||
"\x4f\x62\x6a\x01\x04\x16\x61\x76\x72\x6f\x2e\x73\x63\x68\x65\x6d\x61\x96\x01\x7b\x22\x74\x79\x70\x65\x22\x3a\x22\x72\x65"
|
||||
+ "\x63\x6f\x72\x64\x22\x2c\x22\x6e\x61\x6d\x65\x22\x3a\x22\x73\x6d\x61\x6c\x6c\x22\x2c\x22\x66\x69\x65\x6c\x64\x73\x22\x3a"
|
||||
+ "\x5b\x7b\x22\x6e\x61\x6d\x65\x22\x3a\x22\x6e\x61\x6d\x65\x22\x2c\x22\x74\x79\x70\x65\x22\x3a\x22\x73\x74\x72\x69\x6e\x67"
|
||||
+ "\x22\x7d\x5d\x7d\x14\x61\x76\x72\x6f\x2e\x63\x6f\x64\x65\x63\x08\x6e\x75\x6c\x6c\x00\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7"
|
||||
+ "\x5c\xda\xb9\xa6\x2f\x15\x41\x02\x0e\x0c\x6d\x79\x6e\x61\x6d\x65\x4e\x02\x47\x63\x2e\x37\x02\xe5\xb7\x5c\xda\xb9\xa6\x2f"
|
||||
+ "\x15\x41",
|
||||
expectedOutput: '{"name":"myname"}\n',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Avro to JSON",
|
||||
args: [false]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -22,7 +22,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "To BCD: unpacked nibbles",
|
||||
input: "1234567890",
|
||||
expectedOutput: "0000 0001 0000 0010 0000 0011 0000 0100 0000 0101 0000 0110 0000 0111 0000 1000 0000 1001 0000 0000",
|
||||
expectedOutput:
|
||||
"0000 0001 0000 0010 0000 0011 0000 0100 0000 0101 0000 0110 0000 0111 0000 1000 0000 1001 0000 0000",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "To BCD",
|
||||
|
@ -99,5 +100,5 @@ TestRegister.addTests([
|
|||
"args": ["4 2 2 1", true, true, "Raw"]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,46 +11,33 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "BLAKE2b: 512 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "4386a08a265111c9896f56456e2cb61a64239115c4784cf438e36cc851221972da3fb0115f73cd02486254001f878ab1fd126aac69844ef1c1ca152379d0a9bd",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2b",
|
||||
"args": ["512", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
expectedOutput:
|
||||
"4386a08a265111c9896f56456e2cb61a64239115c4784cf438e36cc851221972da3fb0115f73cd02486254001f878ab1fd126aac69844ef1c1ca152379d0a9bd",
|
||||
recipeConfig: [{ "op": "BLAKE2b", "args": ["512", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2b: 384 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "4d388e82ca8f866e606b6f6f0be910abd62ad6e98c0adfc27cf35acf948986d5c5b9c18b6f47261e1e679eb98edf8e2d",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2b",
|
||||
"args": ["384", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
expectedOutput:
|
||||
"4d388e82ca8f866e606b6f6f0be910abd62ad6e98c0adfc27cf35acf948986d5c5b9c18b6f47261e1e679eb98edf8e2d",
|
||||
recipeConfig: [{ "op": "BLAKE2b", "args": ["384", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2b: 256 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "1dc01772ee0171f5f614c673e3c7fa1107a8cf727bdf5a6dadb379e93c0d1d00",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2b",
|
||||
"args": ["256", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2b", "args": ["256", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2b: 160 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "6a8489e6fd6e51fae12ab271ec7fc8134dd5d737",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2b",
|
||||
"args": ["160", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2b", "args": ["160", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2b: Key Test",
|
||||
input: "message data",
|
||||
expectedOutput: "3d363ff7401e02026f4a4687d4863ced",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2b",
|
||||
"args": ["128", "Hex", {string: "pseudorandom key", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2b", "args": ["128", "Hex", { string: "pseudorandom key", option: "UTF8" }] }]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -12,36 +12,24 @@ TestRegister.addTests([
|
|||
name: "BLAKE2s: 256 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "7706af019148849e516f95ba630307a2018bb7bf03803eca5ed7ed2c3c013513",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2s",
|
||||
"args": ["256", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2s", "args": ["256", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2s: 160 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "0e4fcfc2ee0097ac1d72d70b595a39e09a3c7c7e",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2s",
|
||||
"args": ["160", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2s", "args": ["160", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2s: 128 - Hello World",
|
||||
input: "Hello World",
|
||||
expectedOutput: "9964ee6f36126626bf864363edfa96f6",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2s",
|
||||
"args": ["128", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2s", "args": ["128", "Hex", { string: "", option: "UTF8" }] }]
|
||||
},
|
||||
{
|
||||
name: "BLAKE2s: Key Test",
|
||||
input: "Hello World",
|
||||
expectedOutput: "9964ee6f36126626bf864363edfa96f6",
|
||||
recipeConfig: [
|
||||
{ "op": "BLAKE2s",
|
||||
"args": ["128", "Hex", {string: "", option: "UTF8"}] }
|
||||
]
|
||||
recipeConfig: [{ "op": "BLAKE2s", "args": ["128", "Hex", { string: "", option: "UTF8" }] }]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,20 +16,20 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "BSON serialise",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "BSON serialise: basic",
|
||||
input: "{\"hello\":\"world\"}",
|
||||
input: '{"hello":"world"}',
|
||||
expectedOutput: "\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "BSON serialise",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "BSON deserialise: nothing",
|
||||
|
@ -38,19 +38,19 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "BSON deserialise",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "BSON deserialise: basic",
|
||||
input: "\x16\x00\x00\x00\x02hello\x00\x06\x00\x00\x00world\x00\x00",
|
||||
expectedOutput: "{\n \"hello\": \"world\"\n}",
|
||||
expectedOutput: '{\n "hello": "world"\n}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "BSON deserialise",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -21,7 +21,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[0], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet 0/1",
|
||||
|
@ -32,7 +32,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[0], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet 0/1 inverse",
|
||||
|
@ -43,7 +43,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[0], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet A/B lower case",
|
||||
|
@ -54,7 +54,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[1], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet A/B lower case inverse",
|
||||
|
@ -65,7 +65,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[1], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet A/B upper case",
|
||||
|
@ -76,7 +76,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[1], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet A/B upper case inverse",
|
||||
|
@ -87,7 +87,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[1], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet case code",
|
||||
|
@ -98,7 +98,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[2], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet case code inverse",
|
||||
|
@ -109,7 +109,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[2], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet case code",
|
||||
|
@ -120,7 +120,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[3], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: reduced alphabet case code inverse",
|
||||
|
@ -131,7 +131,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[0], translations[3], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet 0/1",
|
||||
|
@ -142,7 +142,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[0], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet 0/1 inverse",
|
||||
|
@ -153,7 +153,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[0], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet A/B lower case",
|
||||
|
@ -164,7 +164,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[1], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet A/B lower case inverse",
|
||||
|
@ -175,7 +175,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[1], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet A/B upper case",
|
||||
|
@ -186,7 +186,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[1], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet A/B upper case inverse",
|
||||
|
@ -197,7 +197,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[1], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet case code",
|
||||
|
@ -208,7 +208,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[2], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet case code inverse",
|
||||
|
@ -219,7 +219,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[2], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet case code",
|
||||
|
@ -230,7 +230,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[3], false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Decode: complete alphabet case code inverse",
|
||||
|
@ -241,7 +241,7 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Decode",
|
||||
args: [alphabets[1], translations[3], true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: no input",
|
||||
|
@ -252,182 +252,198 @@ TestRegister.addTests([
|
|||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[0], false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet 0/1",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "10010 00111 00100 10000 00100 10001 00000 00101 01101 10101 00000 01100 00011 01000 10010 01000 10011 01011 01110 10001 01101 10011 00100 10000 10010 00111 00100 00101 00100 01100 00010 00100",
|
||||
expectedOutput:
|
||||
"10010 00111 00100 10000 00100 10001 00000 00101 01101 10101 00000 01100 00011 01000 10010 01000 10011 01011 01110 10001 01101 10011 00100 10000 10010 00111 00100 00101 00100 01100 00010 00100",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[0], false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet 0/1 inverse",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "01101 11000 11011 01111 11011 01110 11111 11010 10010 01010 11111 10011 11100 10111 01101 10111 01100 10100 10001 01110 10010 01100 11011 01111 01101 11000 11011 11010 11011 10011 11101 11011",
|
||||
expectedOutput:
|
||||
"01101 11000 11011 01111 11011 01110 11111 11010 10010 01010 11111 10011 11100 10111 01101 10111 01100 10100 10001 01110 10010 01100 11011 01111 01101 11000 11011 11010 11011 10011 11101 11011",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[0], false, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet 0/1, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "1001000111001001000000100'10001 00000 001010110110101, 000000110000011 0100010010 0100010011010110111010001 01101100110010010000 100100011100100 0010100100011000001000100.",
|
||||
expectedOutput:
|
||||
"1001000111001001000000100'10001 00000 001010110110101, 000000110000011 0100010010 0100010011010110111010001 01101100110010010000 100100011100100 0010100100011000001000100.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[0], true, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet 0/1 inverse, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "0110111000110110111111011'01110 11111 110101001001010, 111111001111100 1011101101 1011101100101001000101110 10010011001101101111 011011100011011 1101011011100111110111011.",
|
||||
expectedOutput:
|
||||
"0110111000110110111111011'01110 11111 110101001001010, 111111001111100 1011101101 1011101100101001000101110 10010011001101101111 011011100011011 1101011011100111110111011.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[0], true, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet A/B",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "BAABA AABBB AABAA BAAAA AABAA BAAAB AAAAA AABAB ABBAB BABAB AAAAA ABBAA AAABB ABAAA BAABA ABAAA BAABB ABABB ABBBA BAAAB ABBAB BAABB AABAA BAAAA BAABA AABBB AABAA AABAB AABAA ABBAA AAABA AABAA",
|
||||
expectedOutput:
|
||||
"BAABA AABBB AABAA BAAAA AABAA BAAAB AAAAA AABAB ABBAB BABAB AAAAA ABBAA AAABB ABAAA BAABA ABAAA BAABB ABABB ABBBA BAAAB ABBAB BAABB AABAA BAAAA BAABA AABBB AABAA AABAB AABAA ABBAA AAABA AABAA",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[1], false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet A/B inverse",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "ABBAB BBAAA BBABB ABBBB BBABB ABBBA BBBBB BBABA BAABA ABABA BBBBB BAABB BBBAA BABBB ABBAB BABBB ABBAA BABAA BAAAB ABBBA BAABA ABBAA BBABB ABBBB ABBAB BBAAA BBABB BBABA BBABB BAABB BBBAB BBABB",
|
||||
expectedOutput:
|
||||
"ABBAB BBAAA BBABB ABBBB BBABB ABBBA BBBBB BBABA BAABA ABABA BBBBB BAABB BBBAA BABBB ABBAB BABBB ABBAA BABAA BAAAB ABBBA BAABA ABBAA BBABB ABBBB ABBAB BBAAA BBABB BBABA BBABB BAABB BBBAB BBABB",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[1], false, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet A/B, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "BAABAAABBBAABAABAAAAAABAA'BAAAB AAAAA AABABABBABBABAB, AAAAAABBAAAAABB ABAAABAABA ABAAABAABBABABBABBBABAAAB ABBABBAABBAABAABAAAA BAABAAABBBAABAA AABABAABAAABBAAAAABAAABAA.",
|
||||
expectedOutput:
|
||||
"BAABAAABBBAABAABAAAAAABAA'BAAAB AAAAA AABABABBABBABAB, AAAAAABBAAAAABB ABAAABAABA ABAAABAABBABABBABBBABAAAB ABBABBAABBAABAABAAAA BAABAAABBBAABAA AABABAABAAABBAAAAABAAABAA.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[1], true, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: reduced alphabet A/B inverse, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "ABBABBBAAABBABBABBBBBBABB'ABBBA BBBBB BBABABAABAABABA, BBBBBBAABBBBBAA BABBBABBAB BABBBABBAABABAABAAABABBBA BAABAABBAABBABBABBBB ABBABBBAAABBABB BBABABBABBBAABBBBBABBBABB.",
|
||||
expectedOutput:
|
||||
"ABBABBBAAABBABBABBBBBBABB'ABBBA BBBBB BBABABAABAABABA, BBBBBBAABBBBBAA BABBBABBAB BABBBABBAABABAABAAABABBBA BAABAABBAABBABBABBBB ABBABBBAAABBABB BBABABBABBBAABBBBBABBBABB.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[0], translations[1], true, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet 0/1",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "10011 00111 00100 10001 00100 10010 00000 00101 01110 10111 00000 01101 00011 01000 10011 01001 10100 01100 01111 10010 01110 10101 00100 10001 10011 00111 00100 00101 00100 01101 00010 00100",
|
||||
expectedOutput:
|
||||
"10011 00111 00100 10001 00100 10010 00000 00101 01110 10111 00000 01101 00011 01000 10011 01001 10100 01100 01111 10010 01110 10101 00100 10001 10011 00111 00100 00101 00100 01101 00010 00100",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[0], false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet 0/1 inverse",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "01100 11000 11011 01110 11011 01101 11111 11010 10001 01000 11111 10010 11100 10111 01100 10110 01011 10011 10000 01101 10001 01010 11011 01110 01100 11000 11011 11010 11011 10010 11101 11011",
|
||||
expectedOutput:
|
||||
"01100 11000 11011 01110 11011 01101 11111 11010 10001 01000 11111 10010 11100 10111 01100 10110 01011 10011 10000 01101 10001 01010 11011 01110 01100 11000 11011 11010 11011 10010 11101 11011",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[0], false, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet 0/1, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "1001100111001001000100100'10010 00000 001010111010111, 000000110100011 0100010011 0100110100011000111110010 01110101010010010001 100110011100100 0010100100011010001000100.",
|
||||
expectedOutput:
|
||||
"1001100111001001000100100'10010 00000 001010111010111, 000000110100011 0100010011 0100110100011000111110010 01110101010010010001 100110011100100 0010100100011010001000100.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[0], true, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet 0/1 inverse, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "0110011000110110111011011'01101 11111 110101000101000, 111111001011100 1011101100 1011001011100111000001101 10001010101101101110 011001100011011 1101011011100101110111011.",
|
||||
expectedOutput:
|
||||
"0110011000110110111011011'01101 11111 110101000101000, 111111001011100 1011101100 1011001011100111000001101 10001010101101101110 011001100011011 1101011011100101110111011.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[0], true, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet A/B",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "BAABB AABBB AABAA BAAAB AABAA BAABA AAAAA AABAB ABBBA BABBB AAAAA ABBAB AAABB ABAAA BAABB ABAAB BABAA ABBAA ABBBB BAABA ABBBA BABAB AABAA BAAAB BAABB AABBB AABAA AABAB AABAA ABBAB AAABA AABAA",
|
||||
expectedOutput:
|
||||
"BAABB AABBB AABAA BAAAB AABAA BAABA AAAAA AABAB ABBBA BABBB AAAAA ABBAB AAABB ABAAA BAABB ABAAB BABAA ABBAA ABBBB BAABA ABBBA BABAB AABAA BAAAB BAABB AABBB AABAA AABAB AABAA ABBAB AAABA AABAA",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[1], false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet A/B inverse",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "ABBAA BBAAA BBABB ABBBA BBABB ABBAB BBBBB BBABA BAAAB ABAAA BBBBB BAABA BBBAA BABBB ABBAA BABBA ABABB BAABB BAAAA ABBAB BAAAB ABABA BBABB ABBBA ABBAA BBAAA BBABB BBABA BBABB BAABA BBBAB BBABB",
|
||||
expectedOutput:
|
||||
"ABBAA BBAAA BBABB ABBBA BBABB ABBAB BBBBB BBABA BAAAB ABAAA BBBBB BAABA BBBAA BABBB ABBAA BABBA ABABB BAABB BAAAA ABBAB BAAAB ABABA BBABB ABBBA ABBAA BBAAA BBABB BBABA BBABB BAABA BBBAB BBABB",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[1], false, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet A/B, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "BAABBAABBBAABAABAAABAABAA'BAABA AAAAA AABABABBBABABBB, AAAAAABBABAAABB ABAAABAABB ABAABBABAAABBAAABBBBBAABA ABBBABABABAABAABAAAB BAABBAABBBAABAA AABABAABAAABBABAAABAAABAA.",
|
||||
expectedOutput:
|
||||
"BAABBAABBBAABAABAAABAABAA'BAABA AAAAA AABABABBBABABBB, AAAAAABBABAAABB ABAAABAABB ABAABBABAAABBAAABBBBBAABA ABBBABABABAABAABAAAB BAABBAABBBAABAA AABABAABAAABBABAAABAAABAA.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[1], true, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bacon Encode: complete alphabet A/B inverse, keeping extra characters",
|
||||
input: "There's a fox, and it jumps over the fence.",
|
||||
expectedOutput: "ABBAABBAAABBABBABBBABBABB'ABBAB BBBBB BBABABAAABABAAA, BBBBBBAABABBBAA BABBBABBAA BABBAABABBBAABBBAAAAABBAB BAAABABABABBABBABBBA ABBAABBAAABBABB BBABABBABBBAABABBBABBBABB.",
|
||||
expectedOutput:
|
||||
"ABBAABBAAABBABBABBBABBABB'ABBAB BBBBB BBABABAAABABAAA, BBBBBBAABABBBAA BABBBABBAA BABBAABABBBAABBBAAAAABBAB BAAABABABABBABBABBBA ABBAABBAAABBABB BBABABBABBBAABABBBABBBABB.",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Bacon Cipher Encode",
|
||||
args: [alphabets[1], translations[1], true, true]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -19,9 +19,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base45: Spec encoding example 1",
|
||||
|
@ -30,9 +30,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base45: Spec encoding example 2",
|
||||
|
@ -41,9 +41,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base45: Spec encoding example 3",
|
||||
|
@ -52,9 +52,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base45: nothing",
|
||||
|
@ -63,9 +63,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base45: Spec decoding example 1",
|
||||
|
@ -74,9 +74,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base45: Invalid character",
|
||||
|
@ -85,9 +85,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base45: Invalid triplet value",
|
||||
|
@ -96,8 +96,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [defaultB45Alph],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: [defaultB45Alph]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base58",
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
|
||||
},
|
||||
],
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base58 (Ripple): nothing",
|
||||
|
@ -27,9 +27,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base58",
|
||||
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"],
|
||||
},
|
||||
],
|
||||
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base58 (Bitcoin): 'hello world'",
|
||||
|
@ -38,9 +38,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base58",
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
|
||||
},
|
||||
],
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base58 (Ripple): 'hello world'",
|
||||
|
@ -49,9 +49,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base58",
|
||||
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"],
|
||||
},
|
||||
],
|
||||
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base58 with null prefix and suffix",
|
||||
|
@ -60,9 +60,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base58",
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
|
||||
},
|
||||
],
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base58 with null prefix and suffix",
|
||||
|
@ -71,9 +71,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base58",
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
|
||||
},
|
||||
],
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base58 (Bitcoin): 'StV1DL6CwTryKyV'",
|
||||
|
@ -82,9 +82,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base58",
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
|
||||
},
|
||||
],
|
||||
args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base58 (Ripple): 'StVrDLaUATiyKyV'",
|
||||
|
@ -93,8 +93,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base58",
|
||||
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,9 +17,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base62",
|
||||
args: ["0-9A-Za-z"],
|
||||
},
|
||||
],
|
||||
args: ["0-9A-Za-z"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base62: Hello, World!",
|
||||
|
@ -28,9 +28,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base62",
|
||||
args: ["0-9A-Za-z"],
|
||||
},
|
||||
],
|
||||
args: ["0-9A-Za-z"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base62: UTF-8",
|
||||
|
@ -39,9 +39,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base62",
|
||||
args: ["0-9A-Za-z"],
|
||||
},
|
||||
],
|
||||
args: ["0-9A-Za-z"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base62: nothing",
|
||||
|
@ -50,9 +50,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base62",
|
||||
args: ["0-9A-Za-z"],
|
||||
},
|
||||
],
|
||||
args: ["0-9A-Za-z"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base62: Hello, World!",
|
||||
|
@ -61,9 +61,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base62",
|
||||
args: ["0-9A-Za-z"],
|
||||
},
|
||||
],
|
||||
args: ["0-9A-Za-z"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base62: UTF-8",
|
||||
|
@ -72,8 +72,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base62",
|
||||
args: ["0-9A-Za-z"],
|
||||
},
|
||||
],
|
||||
args: ["0-9A-Za-z"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -24,7 +24,7 @@ const ALL_BYTES = [
|
|||
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
|
||||
"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
|
||||
"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
|
||||
].join("");
|
||||
|
||||
TestRegister.addTests([
|
||||
|
@ -35,9 +35,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base64: Hello, World!",
|
||||
|
@ -46,9 +46,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base64: UTF-8",
|
||||
|
@ -57,20 +57,21 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base64: All bytes",
|
||||
input: ALL_BYTES,
|
||||
expectedOutput: "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",
|
||||
expectedOutput:
|
||||
"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base64: nothing",
|
||||
|
@ -79,9 +80,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base64",
|
||||
args: ["A-Za-z0-9+/=", true],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/=", true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base64: Hello, World!",
|
||||
|
@ -90,9 +91,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base64",
|
||||
args: ["A-Za-z0-9+/=", true],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/=", true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base64: UTF-8",
|
||||
|
@ -101,9 +102,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base64",
|
||||
args: ["A-Za-z0-9+/=", true],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/=", true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base64: All bytes",
|
||||
|
@ -112,8 +113,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base64",
|
||||
args: ["A-Za-z0-9+/=", true],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["A-Za-z0-9+/=", true]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -8,63 +8,52 @@
|
|||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
// Example from Wikipedia
|
||||
const wpExample = "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.";
|
||||
const wpExample
|
||||
= "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.";
|
||||
// Escape newline, quote & backslash
|
||||
const wpOutput = "9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKF<GL>Cj@.4Gp$d7F!,L7@<6@)/0JDEF<G%<+EV:2F!,O<\
|
||||
const wpOutput
|
||||
= "9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKF<GL>Cj@.4Gp$d7F!,L7@<6@)/0JDEF<G%<+EV:2F!,O<\
|
||||
DJ+*.@<*K0@<6L(Df-\\0Ec5e;DffZ(EZee.Bl.9pF\"AGXBPCsi+DGm>@3BB/F*&OCAfu2/AKYi(\
|
||||
DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF<G:8+EV:.+Cf>-FD5W8ARlolDIal(\
|
||||
DId<j@<?3r@:F%a+D58'ATD4$Bl@l3De:,-DJs`8ARoFb/0JMK@qB4^F!,R<AKZ&-DfTqBG%G>u\
|
||||
D.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c";
|
||||
|
||||
const allZeroExample = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
|
||||
const allZeroExample
|
||||
= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
|
||||
|
||||
const allZeroOutput = "zz!!*-'\"9eu7#RLhG$k3[W&.oNg'GVB\"(`=52*$$(B+<_pR,UFcb-n-Vr/1iJ-0JP==1c70M3&s#]4?Ykm5X@_(6q'R884cEH9MJ8X:f1+h<)lt#=BSg3>[:ZC?t!MSA7]@cBPD3sCi+'.E,fo>FEMbNG^4U^I!pHnJ:W<)KS>/9Ll%\"IN/`jYOHG]iPa.Q$R$jD4S=Q7DTV8*TUnsrdW2ZetXKAY/Yd(L?['d?O\\@K2_]Y2%o^qmn*`5Ta:aN;TJbg\"GZd*^:jeCE.%f\\,!5gtgiEi8N\\UjQ5OekiqBum-X60nF?)@o_%qPq\"ad`r;HWp";
|
||||
const allZeroOutput
|
||||
= "zz!!*-'\"9eu7#RLhG$k3[W&.oNg'GVB\"(`=52*$$(B+<_pR,UFcb-n-Vr/1iJ-0JP==1c70M3&s#]4?Ykm5X@_(6q'R884cEH9MJ8X:f1+h<)lt#=BSg3>[:ZC?t!MSA7]@cBPD3sCi+'.E,fo>FEMbNG^4U^I!pHnJ:W<)KS>/9Ll%\"IN/`jYOHG]iPa.Q$R$jD4S=Q7DTV8*TUnsrdW2ZetXKAY/Yd(L?['d?O\\@K2_]Y2%o^qmn*`5Ta:aN;TJbg\"GZd*^:jeCE.%f\\,!5gtgiEi8N\\UjQ5OekiqBum-X60nF?)@o_%qPq\"ad`r;HWp";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "To Base85",
|
||||
input: wpExample,
|
||||
expectedOutput: wpOutput,
|
||||
recipeConfig: [
|
||||
{ "op": "To Base85",
|
||||
"args": ["!-u"] }
|
||||
]
|
||||
recipeConfig: [{ "op": "To Base85", "args": ["!-u"] }]
|
||||
},
|
||||
{
|
||||
name: "From Base85",
|
||||
input: wpOutput + "\n",
|
||||
expectedOutput: wpExample,
|
||||
recipeConfig: [
|
||||
{ "op": "From Base85",
|
||||
"args": ["!-u", true] }
|
||||
]
|
||||
recipeConfig: [{ "op": "From Base85", "args": ["!-u", true] }]
|
||||
},
|
||||
{
|
||||
name: "From Base85",
|
||||
input: wpOutput + "v",
|
||||
expectedError: true,
|
||||
expectedOutput: "From Base85 - Invalid character 'v' at index 337",
|
||||
recipeConfig: [
|
||||
{ "op": "From Base85",
|
||||
"args": ["!-u", false] }
|
||||
]
|
||||
recipeConfig: [{ "op": "From Base85", "args": ["!-u", false] }]
|
||||
},
|
||||
{
|
||||
name: "To Base85",
|
||||
input: allZeroExample,
|
||||
expectedOutput: allZeroOutput,
|
||||
recipeConfig: [
|
||||
{ "op": "To Base85",
|
||||
"args": ["!-u"] }
|
||||
]
|
||||
recipeConfig: [{ "op": "To Base85", "args": ["!-u"] }]
|
||||
},
|
||||
{
|
||||
name: "From Base85",
|
||||
input: allZeroOutput,
|
||||
expectedOutput: allZeroExample,
|
||||
recipeConfig: [
|
||||
{ "op": "From Base85",
|
||||
"args": ["!-u", true, "z"] }
|
||||
]
|
||||
},
|
||||
recipeConfig: [{ "op": "From Base85", "args": ["!-u", true, "z"] }]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base92: Spec encoding example 1",
|
||||
|
@ -27,9 +27,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base92: Spec encoding example 2",
|
||||
|
@ -38,9 +38,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Base92: Spec encoding example 3",
|
||||
|
@ -49,9 +49,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base92: nothing",
|
||||
|
@ -60,9 +60,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base92: Spec decoding example 1",
|
||||
|
@ -71,9 +71,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Base92: Invalid character",
|
||||
|
@ -82,8 +82,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Base92",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -13,12 +13,9 @@ TestRegister.addTests([
|
|||
input: "01010101 10101010 11111111 00000000 11110000 00001111 00110011 11001100",
|
||||
expectedOutput: "10101010 01010100 11111110 00000000 11100000 00011110 01100110 10011000",
|
||||
recipeConfig: [
|
||||
{ "op": "From Binary",
|
||||
"args": ["Space"] },
|
||||
{ "op": "Bit shift left",
|
||||
"args": [1] },
|
||||
{ "op": "To Binary",
|
||||
"args": ["Space"] }
|
||||
{ "op": "From Binary", "args": ["Space"] },
|
||||
{ "op": "Bit shift left", "args": [1] },
|
||||
{ "op": "To Binary", "args": ["Space"] }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -26,12 +23,9 @@ TestRegister.addTests([
|
|||
input: "01010101 10101010 11111111 00000000 11110000 00001111 00110011 11001100",
|
||||
expectedOutput: "00101010 01010101 01111111 00000000 01111000 00000111 00011001 01100110",
|
||||
recipeConfig: [
|
||||
{ "op": "From Binary",
|
||||
"args": ["Space"] },
|
||||
{ "op": "Bit shift right",
|
||||
"args": [1, "Logical shift"] },
|
||||
{ "op": "To Binary",
|
||||
"args": ["Space"] }
|
||||
{ "op": "From Binary", "args": ["Space"] },
|
||||
{ "op": "Bit shift right", "args": [1, "Logical shift"] },
|
||||
{ "op": "To Binary", "args": ["Space"] }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -39,12 +33,9 @@ TestRegister.addTests([
|
|||
input: "01010101 10101010 11111111 00000000 11110000 00001111 00110011 11001100",
|
||||
expectedOutput: "00101010 11010101 11111111 00000000 11111000 00000111 00011001 11100110",
|
||||
recipeConfig: [
|
||||
{ "op": "From Binary",
|
||||
"args": ["Space"] },
|
||||
{ "op": "Bit shift right",
|
||||
"args": [1, "Arithmetic shift"] },
|
||||
{ "op": "To Binary",
|
||||
"args": ["Space"] }
|
||||
{ "op": "From Binary", "args": ["Space"] },
|
||||
{ "op": "Bit shift right", "args": [1, "Arithmetic shift"] },
|
||||
{ "op": "To Binary", "args": ["Space"] }
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -22,7 +22,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"THISISATESTMESSAGE", 0, false
|
||||
"THISISATESTMESSAGE",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -42,7 +44,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"THISISATESTMESSAGE", 0, false
|
||||
"THISISATESTMESSAGE",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -61,7 +65,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"THISISATESTMESSAGE", 3, false
|
||||
"THISISATESTMESSAGE",
|
||||
3,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -80,7 +86,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"THISISATESTM", 0, false
|
||||
"THISISATESTM",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -99,7 +107,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"THISISATESTM", 0, true
|
||||
"THISISATESTM",
|
||||
0,
|
||||
true
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -138,7 +148,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"", 0, false
|
||||
"",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -157,7 +169,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"A", 0, false
|
||||
"A",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -176,7 +190,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"AAAAAAAA", 0, false
|
||||
"AAAAAAAA",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -195,7 +211,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"CCCCCCCCCCCCCCCCCCCCCC", 0, false
|
||||
"CCCCCCCCCCCCCCCCCCCCCC",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -214,7 +232,9 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"AAAAAAAAAAAAAAAAAAAAAAAAAA", 0, false
|
||||
"AAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -233,10 +253,12 @@ TestRegister.addTests([
|
|||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"BBBBB", -1, false
|
||||
"BBBBB",
|
||||
-1,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
// Enigma tests cover validation of rotors and reflector
|
||||
]);
|
||||
|
|
|
@ -23,7 +23,7 @@ const ALL_BYTES = [
|
|||
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
|
||||
"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
|
||||
"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
|
||||
].join("");
|
||||
|
||||
TestRegister.addTests([
|
||||
|
@ -101,18 +101,19 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "To Hex",
|
||||
args: ["Space"]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Hex: All bytes",
|
||||
input: ALL_BYTES,
|
||||
expectedOutput: "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff",
|
||||
expectedOutput:
|
||||
"00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Hex",
|
||||
args: ["Space"]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -123,7 +124,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "To Hex",
|
||||
args: ["None"]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -167,18 +168,19 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "To Charcode",
|
||||
args: ["Space", 16]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Charcode: All bytes",
|
||||
input: ALL_BYTES,
|
||||
expectedOutput: "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff",
|
||||
expectedOutput:
|
||||
"00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Charcode",
|
||||
args: ["Space", 16]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -189,7 +191,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "To Charcode",
|
||||
args: ["Space", 16]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -224,5 +226,5 @@ TestRegister.addTests([
|
|||
args: ["Space", 16]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -42,7 +42,7 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "From Hex: Can decode text",
|
||||
input: "64 54 65 78 74",
|
||||
expectedOutput: "\"Text\"",
|
||||
expectedOutput: '"Text"',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
|
@ -87,7 +87,7 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "From Hex: Can decode map",
|
||||
input: "a3 61 61 01 61 62 02 61 63 03",
|
||||
expectedOutput: JSON.stringify({a: 1, b: 2, c: 3}),
|
||||
expectedOutput: JSON.stringify({ a: 1, b: 2, c: 3 }),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
|
@ -124,8 +124,8 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
name: "From Hex: Can round trip with encode",
|
||||
input: JSON.stringify({a: 1, b: false, c: [1, 2, 3]}),
|
||||
expectedOutput: JSON.stringify({a: 1, b: false, c: [1, 2, 3]}),
|
||||
input: JSON.stringify({ a: 1, b: false, c: [1, 2, 3] }),
|
||||
expectedOutput: JSON.stringify({ a: 1, b: false, c: [1, 2, 3] }),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "CBOR Encode",
|
||||
|
|
|
@ -41,7 +41,7 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
name: "CBOR Encode: Can encode text",
|
||||
input: "\"Text\"",
|
||||
input: '"Text"',
|
||||
expectedOutput: "64 54 65 78 74",
|
||||
recipeConfig: [
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
name: "CBOR Encode: Can encode map",
|
||||
input: JSON.stringify({a: 1, b: 2, c: 3}),
|
||||
input: JSON.stringify({ a: 1, b: 2, c: 3 }),
|
||||
expectedOutput: "a3 61 61 01 61 62 02 61 63 03",
|
||||
recipeConfig: [
|
||||
{
|
||||
|
|
|
@ -16,8 +16,8 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -31,8 +31,8 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -46,13 +46,14 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CMAC-AES128 NIST's CSRC Example #4",
|
||||
"input": "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
|
||||
"input":
|
||||
"6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
|
||||
"expectedOutput": "51f0bebf7e3b9d92fc49741779363cfe",
|
||||
"recipeConfig": [
|
||||
{
|
||||
|
@ -61,8 +62,8 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "2b7e151628aed2a6abf7158809cf4f3c" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -72,8 +73,8 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -87,8 +88,8 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -102,13 +103,14 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CMAC-AES192 NIST's CSRC Example #4",
|
||||
"input": "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
|
||||
"input":
|
||||
"6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
|
||||
"expectedOutput": "a1d5df0eed790f794d77589659f39a11",
|
||||
"recipeConfig": [
|
||||
{
|
||||
|
@ -117,8 +119,8 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -128,8 +130,11 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"}, "AES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4" },
|
||||
"AES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -143,8 +148,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"}, "AES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4" },
|
||||
"AES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -158,13 +166,17 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"}, "AES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4" },
|
||||
"AES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CMAC-AES256 NIST's CSRC Example #4",
|
||||
"input": "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
|
||||
"input":
|
||||
"6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
|
||||
"expectedOutput": "e1992190549f6ed5696a2c056c315410",
|
||||
"recipeConfig": [
|
||||
{
|
||||
|
@ -173,8 +185,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"}, "AES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4" },
|
||||
"AES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -184,8 +199,11 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -199,8 +217,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -214,8 +235,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -229,8 +253,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef01456789abcdef0123" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -240,8 +267,11 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -255,8 +285,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -270,8 +303,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -285,8 +321,11 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef"}, "Triple DES"]
|
||||
},
|
||||
"args": [
|
||||
{ "option": "Hex", "string": "0123456789abcdef23456789abcdef010123456789abcdef" },
|
||||
"Triple DES"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -296,8 +335,8 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "00112233445566778899aabbccddeeff01234567"}, "AES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff01234567" }, "AES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -307,8 +346,8 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "CMAC",
|
||||
"args": [{"option": "Hex", "string": "00112233445566778899aabbccddeeff01234567"}, "Triple DES"]
|
||||
},
|
||||
"args": [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff01234567" }, "Triple DES"]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -19,82 +19,62 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "CSV to JSON: Array of dictionaries",
|
||||
input: EXAMPLE_CSV,
|
||||
expectedOutput: JSON.stringify([
|
||||
{
|
||||
"A": "1",
|
||||
"B": "2",
|
||||
"C": "3",
|
||||
"D": "4",
|
||||
"E": "5",
|
||||
"F": "6"
|
||||
},
|
||||
{
|
||||
"A": ",",
|
||||
"B": ";",
|
||||
"C": "'",
|
||||
"D": "\"",
|
||||
"E": "",
|
||||
"F": ""
|
||||
},
|
||||
{
|
||||
"A": "\"hello\"",
|
||||
"B": "a\"1",
|
||||
"C": "multi\r\nline",
|
||||
"D": "",
|
||||
"E": "",
|
||||
"F": "end"
|
||||
}
|
||||
], null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
[
|
||||
{
|
||||
"A": "1",
|
||||
"B": "2",
|
||||
"C": "3",
|
||||
"D": "4",
|
||||
"E": "5",
|
||||
"F": "6"
|
||||
},
|
||||
{
|
||||
"A": ",",
|
||||
"B": ";",
|
||||
"C": "'",
|
||||
"D": '"',
|
||||
"E": "",
|
||||
"F": ""
|
||||
},
|
||||
{
|
||||
"A": '"hello"',
|
||||
"B": 'a"1',
|
||||
"C": "multi\r\nline",
|
||||
"D": "",
|
||||
"E": "",
|
||||
"F": "end"
|
||||
}
|
||||
],
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "CSV to JSON",
|
||||
args: [",", "\r\n", "Array of dictionaries"],
|
||||
args: [",", "\r\n", "Array of dictionaries"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "CSV to JSON: Array of arrays",
|
||||
input: EXAMPLE_CSV,
|
||||
expectedOutput: JSON.stringify([
|
||||
expectedOutput: JSON.stringify(
|
||||
[
|
||||
"A",
|
||||
"B",
|
||||
"C",
|
||||
"D",
|
||||
"E",
|
||||
"F"
|
||||
["A", "B", "C", "D", "E", "F"],
|
||||
["1", "2", "3", "4", "5", "6"],
|
||||
[",", ";", "'", '"', "", ""],
|
||||
['"hello"', 'a"1', "multi\r\nline", "", "", "end"]
|
||||
],
|
||||
[
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6"
|
||||
],
|
||||
[
|
||||
",",
|
||||
";",
|
||||
"'",
|
||||
"\"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
[
|
||||
"\"hello\"",
|
||||
"a\"1",
|
||||
"multi\r\nline",
|
||||
"",
|
||||
"",
|
||||
"end"
|
||||
]
|
||||
], null, 4),
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "CSV to JSON",
|
||||
args: [",", "\r\n", "Array of arrays"],
|
||||
args: [",", "\r\n", "Array of arrays"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: Array of dictionaries",
|
||||
|
@ -111,13 +91,13 @@ TestRegister.addTests([
|
|||
"A": ",",
|
||||
"B": ";",
|
||||
"C": "'",
|
||||
"D": "\"",
|
||||
"D": '"',
|
||||
"E": "",
|
||||
"F": ""
|
||||
},
|
||||
{
|
||||
"A": "\"hello\"",
|
||||
"B": "a\"1",
|
||||
"A": '"hello"',
|
||||
"B": 'a"1',
|
||||
"C": "multi\r\nline",
|
||||
"D": "",
|
||||
"E": "",
|
||||
|
@ -128,52 +108,24 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\r\n"],
|
||||
args: [",", "\r\n"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: Array of arrays",
|
||||
input: JSON.stringify([
|
||||
[
|
||||
"A",
|
||||
"B",
|
||||
"C",
|
||||
"D",
|
||||
"E",
|
||||
"F"
|
||||
],
|
||||
[
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6"
|
||||
],
|
||||
[
|
||||
",",
|
||||
";",
|
||||
"'",
|
||||
"\"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
[
|
||||
"\"hello\"",
|
||||
"a\"1",
|
||||
"multi\r\nline",
|
||||
"",
|
||||
"",
|
||||
"end"
|
||||
]
|
||||
["A", "B", "C", "D", "E", "F"],
|
||||
["1", "2", "3", "4", "5", "6"],
|
||||
[",", ";", "'", '"', "", ""],
|
||||
['"hello"', 'a"1', "multi\r\nline", "", "", "end"]
|
||||
]),
|
||||
expectedOutput: EXAMPLE_CSV,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\r\n"],
|
||||
args: [",", "\r\n"]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Caesar Box Cipher",
|
||||
args: ["1"],
|
||||
},
|
||||
],
|
||||
args: ["1"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Caesar Box Cipher: Hello World!",
|
||||
|
@ -27,9 +27,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Caesar Box Cipher",
|
||||
args: ["3"],
|
||||
},
|
||||
],
|
||||
args: ["3"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Caesar Box Cipher: Hello World!",
|
||||
|
@ -38,8 +38,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Caesar Box Cipher",
|
||||
args: ["4"],
|
||||
},
|
||||
],
|
||||
args: ["4"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Caret/M-decode",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
/*
|
||||
|
@ -27,13 +27,13 @@ TestRegister.addTests([
|
|||
*/
|
||||
name: "Caret/M-decode: Full set",
|
||||
input: "^@^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\\^]^^^_ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~^?M-^@M-^AM-^BM-^CM-^DM-^EM-^FM-^GM-^HM-^IM-^JM-^KM-^LM-^MM-^NM-^OM-^PM-^QM-^RM-^SM-^TM-^UM-^VM-^WM-^XM-^YM-^ZM-^[M-^\\M-^]M-^^M-^_M- M-!M-\"M-#M-$M-%M-&M-'M-(M-)M-*M-+M-,M--M-.M-/M-0M-1M-2M-3M-4M-5M-6M-7M-8M-9M-:M-;M-<M-=M->M-?M-@M-AM-BM-CM-DM-EM-FM-GM-HM-IM-JM-KM-LM-MM-NM-OM-PM-QM-RM-SM-TM-UM-VM-WM-XM-YM-ZM-[M-\\M-]M-^M-_M-`M-aM-bM-cM-dM-eM-fM-gM-hM-iM-jM-kM-lM-mM-nM-oM-pM-qM-rM-sM-tM-uM-vM-wM-xM-yM-zM-{M-|M-}M-~M-^?",
|
||||
expectedOutput: "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x1f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\x8d\x2d\x5f\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
expectedOutput:
|
||||
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x1f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\x8d\x2d\x5f\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Caret/M-decode",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -12,56 +12,61 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Cartesian Product",
|
||||
input: "1 2 3 4 5\n\na b c d e",
|
||||
expectedOutput: "(1,a) (1,b) (1,c) (1,d) (1,e) (2,a) (2,b) (2,c) (2,d) (2,e) (3,a) (3,b) (3,c) (3,d) (3,e) (4,a) (4,b) (4,c) (4,d) (4,e) (5,a) (5,b) (5,c) (5,d) (5,e)",
|
||||
expectedOutput:
|
||||
"(1,a) (1,b) (1,c) (1,d) (1,e) (2,a) (2,b) (2,c) (2,d) (2,e) (3,a) (3,b) (3,c) (3,d) (3,e) (4,a) (4,b) (4,c) (4,d) (4,e) (5,a) (5,b) (5,c) (5,d) (5,e)",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Cartesian Product",
|
||||
args: ["\n\n", " "],
|
||||
},
|
||||
],
|
||||
args: ["\n\n", " "]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Cartesian Product: too many on left",
|
||||
input: "1 2 3 4 5 6\n\na b c d e",
|
||||
expectedOutput: "(1,a) (1,b) (1,c) (1,d) (1,e) (2,a) (2,b) (2,c) (2,d) (2,e) (3,a) (3,b) (3,c) (3,d) (3,e) (4,a) (4,b) (4,c) (4,d) (4,e) (5,a) (5,b) (5,c) (5,d) (5,e) (6,a) (6,b) (6,c) (6,d) (6,e)",
|
||||
expectedOutput:
|
||||
"(1,a) (1,b) (1,c) (1,d) (1,e) (2,a) (2,b) (2,c) (2,d) (2,e) (3,a) (3,b) (3,c) (3,d) (3,e) (4,a) (4,b) (4,c) (4,d) (4,e) (5,a) (5,b) (5,c) (5,d) (5,e) (6,a) (6,b) (6,c) (6,d) (6,e)",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Cartesian Product",
|
||||
args: ["\n\n", " "],
|
||||
},
|
||||
],
|
||||
args: ["\n\n", " "]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Cartesian Product: too many on right",
|
||||
input: "1 2 3 4 5\n\na b c d e f",
|
||||
expectedOutput: "(1,a) (1,b) (1,c) (1,d) (1,e) (1,f) (2,a) (2,b) (2,c) (2,d) (2,e) (2,f) (3,a) (3,b) (3,c) (3,d) (3,e) (3,f) (4,a) (4,b) (4,c) (4,d) (4,e) (4,f) (5,a) (5,b) (5,c) (5,d) (5,e) (5,f)",
|
||||
expectedOutput:
|
||||
"(1,a) (1,b) (1,c) (1,d) (1,e) (1,f) (2,a) (2,b) (2,c) (2,d) (2,e) (2,f) (3,a) (3,b) (3,c) (3,d) (3,e) (3,f) (4,a) (4,b) (4,c) (4,d) (4,e) (4,f) (5,a) (5,b) (5,c) (5,d) (5,e) (5,f)",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Cartesian Product",
|
||||
args: ["\n\n", " "],
|
||||
},
|
||||
],
|
||||
args: ["\n\n", " "]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Cartesian Product: item delimiter",
|
||||
input: "1-2-3-4-5\n\na-b-c-d-e",
|
||||
expectedOutput: "(1,a)-(1,b)-(1,c)-(1,d)-(1,e)-(2,a)-(2,b)-(2,c)-(2,d)-(2,e)-(3,a)-(3,b)-(3,c)-(3,d)-(3,e)-(4,a)-(4,b)-(4,c)-(4,d)-(4,e)-(5,a)-(5,b)-(5,c)-(5,d)-(5,e)",
|
||||
expectedOutput:
|
||||
"(1,a)-(1,b)-(1,c)-(1,d)-(1,e)-(2,a)-(2,b)-(2,c)-(2,d)-(2,e)-(3,a)-(3,b)-(3,c)-(3,d)-(3,e)-(4,a)-(4,b)-(4,c)-(4,d)-(4,e)-(5,a)-(5,b)-(5,c)-(5,d)-(5,e)",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Cartesian Product",
|
||||
args: ["\n\n", "-"],
|
||||
},
|
||||
],
|
||||
args: ["\n\n", "-"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Cartesian Product: sample delimiter",
|
||||
input: "1 2 3 4 5_a b c d e",
|
||||
expectedOutput: "(1,a) (1,b) (1,c) (1,d) (1,e) (2,a) (2,b) (2,c) (2,d) (2,e) (3,a) (3,b) (3,c) (3,d) (3,e) (4,a) (4,b) (4,c) (4,d) (4,e) (5,a) (5,b) (5,c) (5,d) (5,e)",
|
||||
expectedOutput:
|
||||
"(1,a) (1,b) (1,c) (1,d) (1,e) (2,a) (2,b) (2,c) (2,d) (2,e) (3,a) (3,b) (3,c) (3,d) (3,e) (4,a) (4,b) (4,c) (4,d) (4,e) (5,a) (5,b) (5,c) (5,d) (5,e)",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Cartesian Product",
|
||||
args: ["_", " "],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["_", " "]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,7 +16,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Cetacean Cipher Decode",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,7 +16,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Cetacean Cipher Encode",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -18,13 +18,9 @@ ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).`,
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": ""},
|
||||
{"option": "Hex", "string": ""},
|
||||
0, "20", "Hex", "Hex",
|
||||
]
|
||||
"args": [{ "option": "Hex", "string": "" }, { "option": "Hex", "string": "" }, 0, "20", "Hex", "Hex"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: no nonce",
|
||||
|
@ -36,116 +32,163 @@ ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).`,
|
|||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
||||
{"option": "Hex", "string": ""},
|
||||
0, "20", "Hex", "Hex",
|
||||
{ "option": "Hex", "string": "00000000000000000000000000000000" },
|
||||
{ "option": "Hex", "string": "" },
|
||||
0,
|
||||
"20",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: RFC8439",
|
||||
input: "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.",
|
||||
expectedOutput: "6e 2e 35 9a 25 68 f9 80 41 ba 07 28 dd 0d 69 81 e9 7e 7a ec 1d 43 60 c2 0a 27 af cc fd 9f ae 0b f9 1b 65 c5 52 47 33 ab 8f 59 3d ab cd 62 b3 57 16 39 d6 24 e6 51 52 ab 8f 53 0c 35 9f 08 61 d8 07 ca 0d bf 50 0d 6a 61 56 a3 8e 08 8a 22 b6 5e 52 bc 51 4d 16 cc f8 06 81 8c e9 1a b7 79 37 36 5a f9 0b bf 74 a3 5b e6 b4 0b 8e ed f2 78 5e 42 87 4d",
|
||||
expectedOutput:
|
||||
"6e 2e 35 9a 25 68 f9 80 41 ba 07 28 dd 0d 69 81 e9 7e 7a ec 1d 43 60 c2 0a 27 af cc fd 9f ae 0b f9 1b 65 c5 52 47 33 ab 8f 59 3d ab cd 62 b3 57 16 39 d6 24 e6 51 52 ab 8f 53 0c 35 9f 08 61 d8 07 ca 0d bf 50 0d 6a 61 56 a3 8e 08 8a 22 b6 5e 52 bc 51 4d 16 cc f8 06 81 8c e9 1a b7 79 37 36 5a f9 0b bf 74 a3 5b e6 b4 0b 8e ed f2 78 5e 42 87 4d",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f:10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f"},
|
||||
{"option": "Hex", "string": "00:00:00:00:00:00:00:4a:00:00:00:00"},
|
||||
1, "20", "Raw", "Hex",
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f:10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f"
|
||||
},
|
||||
{ "option": "Hex", "string": "00:00:00:00:00:00:00:4a:00:00:00:00" },
|
||||
1,
|
||||
"20",
|
||||
"Raw",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: draft-strombergson-chacha-test-vectors-01 TC7.1",
|
||||
input: "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
||||
expectedOutput: "29 56 0d 28 0b 45 28 40 0a 8f 4b 79 53 69 fb 3a 01 10 55 99 e9 f1 ed 58 27 9c fc 9e ce 2d c5 f9 9f 1c 2e 52 c9 82 38 f5 42 a5 c0 a8 81 d8 50 b6 15 d3 ac d9 fb db 02 6e 93 68 56 5d a5 0e 0d 49 dd 5b e8 ef 74 24 8b 3e 25 1d 96 5d 8f cb 21 e7 cf e2 04 d4 00 78 06 fb ee 3c e9 4c 74 bf ba d2 c1 1c 62 1b a0 48 14 7c 5c aa 94 d1 82 cc ff 6f d5 cf 44 ad f9 6e 3d 68 28 1b b4 96 76 af 87 e7",
|
||||
expectedOutput:
|
||||
"29 56 0d 28 0b 45 28 40 0a 8f 4b 79 53 69 fb 3a 01 10 55 99 e9 f1 ed 58 27 9c fc 9e ce 2d c5 f9 9f 1c 2e 52 c9 82 38 f5 42 a5 c0 a8 81 d8 50 b6 15 d3 ac d9 fb db 02 6e 93 68 56 5d a5 0e 0d 49 dd 5b e8 ef 74 24 8b 3e 25 1d 96 5d 8f cb 21 e7 cf e2 04 d4 00 78 06 fb ee 3c e9 4c 74 bf ba d2 c1 1c 62 1b a0 48 14 7c 5c aa 94 d1 82 cc ff 6f d5 cf 44 ad f9 6e 3d 68 28 1b b4 96 76 af 87 e7",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff"},
|
||||
{"option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78"},
|
||||
0, "8", "Hex", "Hex",
|
||||
{ "option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff" },
|
||||
{ "option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78" },
|
||||
0,
|
||||
"8",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: draft-strombergson-chacha-test-vectors-01 TC7.2",
|
||||
input: "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
||||
expectedOutput: "5e dd c2 d9 42 8f ce ee c5 0a 52 a9 64 ea e0 ff b0 4b 2d e0 06 a9 b0 4c ff 36 8f fa 92 11 16 b2 e8 e2 64 ba bd 2e fa 0d e4 3e f2 e3 b6 d0 65 e8 f7 c0 a1 78 37 b0 a4 0e b0 e2 c7 a3 74 2c 87 53 ed e5 f3 f6 d1 9b e5 54 67 5e 50 6a 77 5c 63 f0 94 d4 96 5c 31 93 19 dc d7 50 6f 45 7b 11 7b 84 b1 0b 24 6e 95 6c 2d a8 89 8a 65 6c ee f3 f7 b7 16 45 b1 9f 70 1d b8 44 85 ce 51 21 f0 f6 17 ef",
|
||||
expectedOutput:
|
||||
"5e dd c2 d9 42 8f ce ee c5 0a 52 a9 64 ea e0 ff b0 4b 2d e0 06 a9 b0 4c ff 36 8f fa 92 11 16 b2 e8 e2 64 ba bd 2e fa 0d e4 3e f2 e3 b6 d0 65 e8 f7 c0 a1 78 37 b0 a4 0e b0 e2 c7 a3 74 2c 87 53 ed e5 f3 f6 d1 9b e5 54 67 5e 50 6a 77 5c 63 f0 94 d4 96 5c 31 93 19 dc d7 50 6f 45 7b 11 7b 84 b1 0b 24 6e 95 6c 2d a8 89 8a 65 6c ee f3 f7 b7 16 45 b1 9f 70 1d b8 44 85 ce 51 21 f0 f6 17 ef",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff"},
|
||||
{"option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78"},
|
||||
0, "12", "Hex", "Hex",
|
||||
{ "option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff" },
|
||||
{ "option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78" },
|
||||
0,
|
||||
"12",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: draft-strombergson-chacha-test-vectors-01 TC7.3",
|
||||
input: "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
||||
expectedOutput: "d1 ab f6 30 46 7e b4 f6 7f 1c fb 47 cd 62 6a ae 8a fe db be 4f f8 fc 5f e9 cf ae 30 7e 74 ed 45 1f 14 04 42 5a d2 b5 45 69 d5 f1 81 48 93 99 71 ab b8 fa fc 88 ce 4a c7 fe 1c 3d 1f 7a 1e b7 ca e7 6c a8 7b 61 a9 71 35 41 49 77 60 dd 9a e0 59 35 0c ad 0d ce df aa 80 a8 83 11 9a 1a 6f 98 7f d1 ce 91 fd 8e e0 82 80 34 b4 11 20 0a 97 45 a2 85 55 44 75 d1 2a fc 04 88 7f ef 35 16 d1 2a 2c",
|
||||
expectedOutput:
|
||||
"d1 ab f6 30 46 7e b4 f6 7f 1c fb 47 cd 62 6a ae 8a fe db be 4f f8 fc 5f e9 cf ae 30 7e 74 ed 45 1f 14 04 42 5a d2 b5 45 69 d5 f1 81 48 93 99 71 ab b8 fa fc 88 ce 4a c7 fe 1c 3d 1f 7a 1e b7 ca e7 6c a8 7b 61 a9 71 35 41 49 77 60 dd 9a e0 59 35 0c ad 0d ce df aa 80 a8 83 11 9a 1a 6f 98 7f d1 ce 91 fd 8e e0 82 80 34 b4 11 20 0a 97 45 a2 85 55 44 75 d1 2a fc 04 88 7f ef 35 16 d1 2a 2c",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff"},
|
||||
{"option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78"},
|
||||
0, "20", "Hex", "Hex",
|
||||
{ "option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff" },
|
||||
{ "option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78" },
|
||||
0,
|
||||
"20",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: draft-strombergson-chacha-test-vectors-01 TC7.4",
|
||||
input: "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
||||
expectedOutput: "db 43 ad 9d 1e 84 2d 12 72 e4 53 0e 27 6b 3f 56 8f 88 59 b3 f7 cf 6d 9d 2c 74 fa 53 80 8c b5 15 7a 8e bf 46 ad 3d cc 4b 6c 7d ad de 13 17 84 b0 12 0e 0e 22 f6 d5 f9 ff a7 40 7d 4a 21 b6 95 d9 c5 dd 30 bf 55 61 2f ab 9b dd 11 89 20 c1 98 16 47 0c 7f 5d cd 42 32 5d bb ed 8c 57 a5 62 81 c1 44 cb 0f 03 e8 1b 30 04 62 4e 06 50 a1 ce 5a fa f9 a7 cd 81 63 f6 db d7 26 02 25 7d d9 6e 47 1e",
|
||||
expectedOutput:
|
||||
"db 43 ad 9d 1e 84 2d 12 72 e4 53 0e 27 6b 3f 56 8f 88 59 b3 f7 cf 6d 9d 2c 74 fa 53 80 8c b5 15 7a 8e bf 46 ad 3d cc 4b 6c 7d ad de 13 17 84 b0 12 0e 0e 22 f6 d5 f9 ff a7 40 7d 4a 21 b6 95 d9 c5 dd 30 bf 55 61 2f ab 9b dd 11 89 20 c1 98 16 47 0c 7f 5d cd 42 32 5d bb ed 8c 57 a5 62 81 c1 44 cb 0f 03 e8 1b 30 04 62 4e 06 50 a1 ce 5a fa f9 a7 cd 81 63 f6 db d7 26 02 25 7d d9 6e 47 1e",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00"},
|
||||
{"option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78"},
|
||||
0, "8", "Hex", "Hex",
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00"
|
||||
},
|
||||
{ "option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78" },
|
||||
0,
|
||||
"8",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: draft-strombergson-chacha-test-vectors-01 TC7.5",
|
||||
input: "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
||||
expectedOutput: "7e d1 2a 3a 63 91 2a e9 41 ba 6d 4c 0d 5e 86 2e 56 8b 0e 55 89 34 69 35 50 5f 06 4b 8c 26 98 db f7 d8 50 66 7d 8e 67 be 63 9f 3b 4f 6a 16 f9 2e 65 ea 80 f6 c7 42 94 45 da 1f c2 c1 b9 36 50 40 e3 2e 50 c4 10 6f 3b 3d a1 ce 7c cb 1e 71 40 b1 53 49 3c 0f 3a d9 a9 bc ff 07 7e c4 59 6f 1d 0f 29 bf 9c ba a5 02 82 0f 73 2a f5 a9 3c 49 ee e3 3d 1c 4f 12 af 3b 42 97 af 91 fe 41 ea 9e 94 a2",
|
||||
expectedOutput:
|
||||
"7e d1 2a 3a 63 91 2a e9 41 ba 6d 4c 0d 5e 86 2e 56 8b 0e 55 89 34 69 35 50 5f 06 4b 8c 26 98 db f7 d8 50 66 7d 8e 67 be 63 9f 3b 4f 6a 16 f9 2e 65 ea 80 f6 c7 42 94 45 da 1f c2 c1 b9 36 50 40 e3 2e 50 c4 10 6f 3b 3d a1 ce 7c cb 1e 71 40 b1 53 49 3c 0f 3a d9 a9 bc ff 07 7e c4 59 6f 1d 0f 29 bf 9c ba a5 02 82 0f 73 2a f5 a9 3c 49 ee e3 3d 1c 4f 12 af 3b 42 97 af 91 fe 41 ea 9e 94 a2",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00"},
|
||||
{"option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78"},
|
||||
0, "12", "Hex", "Hex",
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00"
|
||||
},
|
||||
{ "option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78" },
|
||||
0,
|
||||
"12",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ChaCha: draft-strombergson-chacha-test-vectors-01 TC7.6",
|
||||
input: "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
|
||||
expectedOutput: "9f ad f4 09 c0 08 11 d0 04 31 d6 7e fb d8 8f ba 59 21 8d 5d 67 08 b1 d6 85 86 3f ab bb 0e 96 1e ea 48 0f d6 fb 53 2b fd 49 4b 21 51 01 50 57 42 3a b6 0a 63 fe 4f 55 f7 a2 12 e2 16 7c ca b9 31 fb fd 29 cf 7b c1 d2 79 ed df 25 dd 31 6b b8 84 3d 6e de e0 bd 1e f1 21 d1 2f a1 7c bc 2c 57 4c cc ab 5e 27 51 67 b0 8b d6 86 f8 a0 9d f8 7e c3 ff b3 53 61 b9 4e bf a1 3f ec 0e 48 89 d1 8d a5",
|
||||
expectedOutput:
|
||||
"9f ad f4 09 c0 08 11 d0 04 31 d6 7e fb d8 8f ba 59 21 8d 5d 67 08 b1 d6 85 86 3f ab bb 0e 96 1e ea 48 0f d6 fb 53 2b fd 49 4b 21 51 01 50 57 42 3a b6 0a 63 fe 4f 55 f7 a2 12 e2 16 7c ca b9 31 fb fd 29 cf 7b c1 d2 79 ed df 25 dd 31 6b b8 84 3d 6e de e0 bd 1e f1 21 d1 2f a1 7c bc 2c 57 4c cc ab 5e 27 51 67 b0 8b d6 86 f8 a0 9d f8 7e c3 ff b3 53 61 b9 4e bf a1 3f ec 0e 48 89 d1 8d a5",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "ChaCha",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00"},
|
||||
{"option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78"},
|
||||
0, "20", "Hex", "Hex",
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00"
|
||||
},
|
||||
{ "option": "Hex", "string": "0f 1e 2d 3c 4b 5a 69 78" },
|
||||
0,
|
||||
"20",
|
||||
"Hex",
|
||||
"Hex"
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -15,38 +15,41 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Change IP format",
|
||||
args: ["Dotted Decimal", "Hex"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: ["Dotted Decimal", "Hex"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Change IP format: Decimal to Dotted Decimal",
|
||||
input: "3232235777",
|
||||
expectedOutput: "192.168.1.1",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Change IP format",
|
||||
args: ["Decimal", "Dotted Decimal"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: ["Decimal", "Dotted Decimal"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Change IP format: Hex to Octal",
|
||||
input: "c0a80101",
|
||||
expectedOutput: "030052000401",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Change IP format",
|
||||
args: ["Hex", "Octal"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: ["Hex", "Octal"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Change IP format: Octal to Decimal",
|
||||
input: "030052000401",
|
||||
expectedOutput: "3232235777",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Change IP format",
|
||||
args: ["Octal", "Decimal"],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["Octal", "Decimal"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -20,8 +20,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Decode text",
|
||||
"args": ["UTF-8 (65001)"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Encode text, Decode text: hello",
|
||||
|
@ -35,8 +35,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Decode text",
|
||||
"args": ["UTF-8 (65001)"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Encode text (EBCDIC): hello",
|
||||
|
@ -50,8 +50,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "To Hex",
|
||||
"args": ["Space"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Decode text (EBCDIC): 88 85 93 93 96",
|
||||
|
@ -65,13 +65,13 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Decode text",
|
||||
"args": ["IBM EBCDIC International (500)"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Generate Base64 Windows PowerShell",
|
||||
input: "ZABpAHIAIAAiAGMAOgBcAHAAcgBvAGcAcgBhAG0AIABmAGkAbABlAHMAIgAgAA==",
|
||||
expectedOutput: "dir \"c:\\program files\" ",
|
||||
expectedOutput: 'dir "c:\\program files" ',
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Base64",
|
||||
|
@ -84,7 +84,7 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Encode text",
|
||||
"args": ["UTF-8 (65001)"]
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
"op": "Scatter chart",
|
||||
"args": ["Line feed", "Space", false, "time", "stress", "black", 5, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Hex density chart",
|
||||
|
@ -28,7 +28,7 @@ TestRegister.addTests([
|
|||
"op": "Hex Density chart",
|
||||
"args": ["Line feed", "Space", 25, 15, true, "", "", true, "white", "black", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Series chart",
|
||||
|
@ -39,7 +39,7 @@ TestRegister.addTests([
|
|||
"op": "Series chart",
|
||||
"args": ["Line feed", "Space", "", 1, "mediumseagreen, dodgerblue, tomato"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Heatmap chart",
|
||||
|
@ -50,6 +50,6 @@ TestRegister.addTests([
|
|||
"op": "Heatmap chart",
|
||||
"args": ["Line feed", "Space", 25, 25, true, "", "", false, "white", "black"]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -25,7 +25,7 @@ const ALL_BYTES = [
|
|||
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
|
||||
"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
|
||||
"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
|
||||
].join("");
|
||||
|
||||
TestRegister.addTests([
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "CipherSaber2 Encrypt",
|
||||
args: [{ "option": "Latin1", "string": "test" }, 20],
|
||||
},
|
||||
],
|
||||
args: [{ "option": "Latin1", "string": "test" }, 20]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "CipherSaber2 Decrypt",
|
||||
|
@ -27,9 +27,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "CipherSaber2 Decrypt",
|
||||
args: [{ "option": "Latin1", "string": "test" }, 20],
|
||||
},
|
||||
],
|
||||
args: [{ "option": "Latin1", "string": "test" }, 20]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "CipherSaber2 Encrypt",
|
||||
|
@ -38,8 +38,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "CipherSaber2 Encrypt",
|
||||
args: [{ "option": "Latin1", "string": "" }, 20],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: [{ "option": "Latin1", "string": "" }, 20]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Affine Encode: no input",
|
||||
|
@ -20,7 +19,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Encode",
|
||||
args: [1, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Encode: invalid a & b (non-integer)",
|
||||
|
@ -31,7 +30,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Encode",
|
||||
args: [0.1, 0.00001]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Encode: no effect",
|
||||
|
@ -42,7 +41,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Encode",
|
||||
args: [1, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Encode: normal",
|
||||
|
@ -53,7 +52,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Encode",
|
||||
args: [23, 23]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Decode: no input",
|
||||
|
@ -64,7 +63,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Decode",
|
||||
args: [1, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Decode: invalid a & b (non-integer)",
|
||||
|
@ -75,7 +74,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Decode",
|
||||
args: [0.1, 0.00001]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Decode: invalid a (coprime)",
|
||||
|
@ -86,7 +85,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Decode",
|
||||
args: [8, 23]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Decode: no effect",
|
||||
|
@ -97,7 +96,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Decode",
|
||||
args: [1, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Affine Decode: normal",
|
||||
|
@ -108,7 +107,7 @@ TestRegister.addTests([
|
|||
op: "Affine Cipher Decode",
|
||||
args: [23, 23]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "A1Z26 Encode: normal",
|
||||
|
@ -119,7 +118,7 @@ TestRegister.addTests([
|
|||
op: "A1Z26 Cipher Encode",
|
||||
args: ["Space"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "A1Z26 Decode: normal",
|
||||
|
@ -130,7 +129,7 @@ TestRegister.addTests([
|
|||
op: "A1Z26 Cipher Decode",
|
||||
args: ["Space"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "A1Z26 Decode: error",
|
||||
|
@ -141,7 +140,7 @@ TestRegister.addTests([
|
|||
op: "A1Z26 Cipher Decode",
|
||||
args: ["Space"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Atbash: no input",
|
||||
|
@ -152,7 +151,7 @@ TestRegister.addTests([
|
|||
op: "Atbash Cipher",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Atbash: normal",
|
||||
|
@ -163,7 +162,7 @@ TestRegister.addTests([
|
|||
op: "Atbash Cipher",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Encode: no input",
|
||||
|
@ -174,7 +173,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Encode",
|
||||
"args": ["nothing"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Encode: no key",
|
||||
|
@ -185,7 +184,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Encode",
|
||||
"args": [""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Encode: invalid key (non-alphabetic)",
|
||||
|
@ -196,7 +195,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Encode",
|
||||
"args": ["abc123"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Encode: normal",
|
||||
|
@ -207,7 +206,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Encode",
|
||||
"args": ["Schrodinger"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Decode: no input",
|
||||
|
@ -218,7 +217,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Decode",
|
||||
"args": ["nothing"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Decode: no key",
|
||||
|
@ -229,7 +228,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Decode",
|
||||
"args": [""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Decode: invalid key (non-alphabetic)",
|
||||
|
@ -240,7 +239,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Decode",
|
||||
"args": ["abc123"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Bifid Cipher Decode: normal",
|
||||
|
@ -251,7 +250,7 @@ TestRegister.addTests([
|
|||
"op": "Bifid Cipher Decode",
|
||||
"args": ["Schrodinger"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Citrix CTX1 Encode",
|
||||
|
@ -262,7 +261,7 @@ TestRegister.addTests([
|
|||
"op": "Citrix CTX1 Encode",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Citrix CTX1 Decode: normal",
|
||||
|
@ -273,7 +272,7 @@ TestRegister.addTests([
|
|||
"op": "Citrix CTX1 Decode",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Citrix CTX1 Decode: invalid length",
|
||||
|
@ -284,7 +283,7 @@ TestRegister.addTests([
|
|||
"op": "Citrix CTX1 Decode",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Encode: no input",
|
||||
|
@ -295,7 +294,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Encode",
|
||||
"args": ["nothing"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Encode: no key",
|
||||
|
@ -306,7 +305,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Encode",
|
||||
"args": [""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Encode: invalid key",
|
||||
|
@ -317,7 +316,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Encode",
|
||||
"args": ["abc123"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Encode: normal",
|
||||
|
@ -328,7 +327,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Encode",
|
||||
"args": ["Edward"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Decode: no input",
|
||||
|
@ -339,7 +338,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Decode",
|
||||
"args": ["nothing"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Decode: no key",
|
||||
|
@ -350,7 +349,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Decode",
|
||||
"args": [""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Decode: invalid key",
|
||||
|
@ -361,7 +360,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Decode",
|
||||
"args": ["abc123"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Vigenère Decode: normal",
|
||||
|
@ -372,7 +371,7 @@ TestRegister.addTests([
|
|||
"op": "Vigenère Decode",
|
||||
"args": ["Edward"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Substitute: no pt/ct",
|
||||
|
@ -383,7 +382,7 @@ TestRegister.addTests([
|
|||
"op": "Substitute",
|
||||
"args": ["", ""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Substitute: no input",
|
||||
|
@ -394,7 +393,7 @@ TestRegister.addTests([
|
|||
"op": "Substitute",
|
||||
"args": ["abcdefghijklmnopqrstuvwxyz", "zebrascdfghijklmnopqtuvwxy"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Substitute: uneven pt/ct",
|
||||
|
@ -405,7 +404,7 @@ TestRegister.addTests([
|
|||
"op": "Substitute",
|
||||
"args": ["abcdefghijklmnopqrstuvwxyz", "zebrascdfghijklmnopqtuvwx"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Substitute: normal",
|
||||
|
@ -416,7 +415,7 @@ TestRegister.addTests([
|
|||
"op": "Substitute",
|
||||
"args": ["abcdefghijklmnopqrstuvwxyz", "zebrascdfghijklmnopqtuvwxy"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Decode: normal",
|
||||
|
@ -427,7 +426,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Decode",
|
||||
"args": [2, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Decode: key has to be bigger than 2",
|
||||
|
@ -438,7 +437,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Decode",
|
||||
"args": [1, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Decode: key has to be smaller than input's length",
|
||||
|
@ -449,7 +448,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Decode",
|
||||
"args": [22, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Decode: offset should be positive",
|
||||
|
@ -460,7 +459,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Decode",
|
||||
"args": [2, -1]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Decode: Normal with Offset non-null",
|
||||
|
@ -471,7 +470,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Decode",
|
||||
"args": [4, 2]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Encode: normal",
|
||||
|
@ -482,7 +481,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Encode",
|
||||
"args": [2, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Encode: key has to be bigger than 2",
|
||||
|
@ -493,7 +492,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Encode",
|
||||
"args": [1, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Encode: key has to be smaller than input's length",
|
||||
|
@ -504,7 +503,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Encode",
|
||||
"args": [22, 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Encode: offset should be positive",
|
||||
|
@ -515,7 +514,7 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Encode",
|
||||
"args": [2, -1]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Rail Fence Cipher Encode: Normal with Offset non-null",
|
||||
|
@ -526,6 +525,6 @@ TestRegister.addTests([
|
|||
"op": "Rail Fence Cipher Encode",
|
||||
"args": [4, 2]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,42 +11,50 @@ import TestRegister from "../../lib/TestRegister.mjs";
|
|||
|
||||
const JSON_TEST_DATA = {
|
||||
"store": {
|
||||
"book": [{
|
||||
"category": "reference",
|
||||
"author": "Nigel Rees",
|
||||
"title": "Sayings of the Century",
|
||||
"price": 8.95
|
||||
}, {
|
||||
"category": "fiction",
|
||||
"author": "Evelyn Waugh",
|
||||
"title": "Sword of Honour",
|
||||
"price": 12.99
|
||||
}, {
|
||||
"category": "fiction",
|
||||
"author": "Herman Melville",
|
||||
"title": "Moby Dick",
|
||||
"isbn": "0-553-21311-3",
|
||||
"price": 8.99
|
||||
}, {
|
||||
"category": "fiction",
|
||||
"author": "J. R. R. Tolkien",
|
||||
"title": "The Lord of the Rings",
|
||||
"isbn": "0-395-19395-8",
|
||||
"price": 22.99
|
||||
}],
|
||||
"book": [
|
||||
{
|
||||
"category": "reference",
|
||||
"author": "Nigel Rees",
|
||||
"title": "Sayings of the Century",
|
||||
"price": 8.95
|
||||
},
|
||||
{
|
||||
"category": "fiction",
|
||||
"author": "Evelyn Waugh",
|
||||
"title": "Sword of Honour",
|
||||
"price": 12.99
|
||||
},
|
||||
{
|
||||
"category": "fiction",
|
||||
"author": "Herman Melville",
|
||||
"title": "Moby Dick",
|
||||
"isbn": "0-553-21311-3",
|
||||
"price": 8.99
|
||||
},
|
||||
{
|
||||
"category": "fiction",
|
||||
"author": "J. R. R. Tolkien",
|
||||
"title": "The Lord of the Rings",
|
||||
"isbn": "0-395-19395-8",
|
||||
"price": 22.99
|
||||
}
|
||||
],
|
||||
"bicycle": {
|
||||
"color": "red",
|
||||
"price": 19.95
|
||||
},
|
||||
"newspaper": [{
|
||||
"format": "broadsheet",
|
||||
"title": "Financial Times",
|
||||
"price": 2.75
|
||||
}, {
|
||||
"format": "tabloid",
|
||||
"title": "The Guardian",
|
||||
"price": 2.00
|
||||
}]
|
||||
"newspaper": [
|
||||
{
|
||||
"format": "broadsheet",
|
||||
"title": "Financial Times",
|
||||
"price": 2.75
|
||||
},
|
||||
{
|
||||
"format": "tabloid",
|
||||
"title": "The Guardian",
|
||||
"price": 2.0
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -60,7 +68,7 @@ TestRegister.addTests([
|
|||
"op": "To Camel case",
|
||||
"args": [false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Snake case (dumb)",
|
||||
|
@ -71,7 +79,7 @@ TestRegister.addTests([
|
|||
"op": "To Snake case",
|
||||
"args": [false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Kebab case (dumb)",
|
||||
|
@ -82,7 +90,7 @@ TestRegister.addTests([
|
|||
"op": "To Kebab case",
|
||||
"args": [false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Camel case (smart)",
|
||||
|
@ -93,8 +101,8 @@ TestRegister.addTests([
|
|||
"$a_camel_case_variable;",
|
||||
"function function_name() {",
|
||||
" console.log('things inside quotes do not get broken');",
|
||||
" console.log(\"things inside quotes do not get broken\");",
|
||||
"}",
|
||||
' console.log("things inside quotes do not get broken");',
|
||||
"}"
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"test='hello'",
|
||||
|
@ -103,15 +111,15 @@ TestRegister.addTests([
|
|||
"$aCamelCaseVariable;",
|
||||
"function functionName() {",
|
||||
" console.log('things inside quotes do not get broken');",
|
||||
" console.log(\"things inside quotes do not get broken\");",
|
||||
"}",
|
||||
' console.log("things inside quotes do not get broken");',
|
||||
"}"
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "To Camel case",
|
||||
"args": [true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Snake case (smart)",
|
||||
|
@ -122,8 +130,8 @@ TestRegister.addTests([
|
|||
"$aSnakeCaseVariable;",
|
||||
"function functionName() {",
|
||||
" console.log('things inside quotes do not get broken');",
|
||||
" console.log(\"things inside quotes do not get broken\");",
|
||||
"}",
|
||||
' console.log("things inside quotes do not get broken");',
|
||||
"}"
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"test='hello'",
|
||||
|
@ -132,15 +140,15 @@ TestRegister.addTests([
|
|||
"$a_snake_case_variable;",
|
||||
"function function_name() {",
|
||||
" console.log('things inside quotes do not get broken');",
|
||||
" console.log(\"things inside quotes do not get broken\");",
|
||||
"}",
|
||||
' console.log("things inside quotes do not get broken");',
|
||||
"}"
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "To Snake case",
|
||||
"args": [true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Kebab case (smart)",
|
||||
|
@ -151,8 +159,8 @@ TestRegister.addTests([
|
|||
"$aKebabCaseVariable;",
|
||||
"function functionName() {",
|
||||
" console.log('things inside quotes do not get broken');",
|
||||
" console.log(\"things inside quotes do not get broken\");",
|
||||
"}",
|
||||
' console.log("things inside quotes do not get broken");',
|
||||
"}"
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"test='hello'",
|
||||
|
@ -161,15 +169,15 @@ TestRegister.addTests([
|
|||
"$a-kebab-case-variable;",
|
||||
"function function-name() {",
|
||||
" console.log('things inside quotes do not get broken');",
|
||||
" console.log(\"things inside quotes do not get broken\");",
|
||||
"}",
|
||||
' console.log("things inside quotes do not get broken");',
|
||||
"}"
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "To Kebab case",
|
||||
"args": [true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: Empty JSON",
|
||||
|
@ -180,7 +188,7 @@ TestRegister.addTests([
|
|||
"op": "JPath expression",
|
||||
"args": ["", "\n"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: Empty expression",
|
||||
|
@ -191,124 +199,120 @@ TestRegister.addTests([
|
|||
"op": "JPath expression",
|
||||
"args": ["", "\n", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: Fetch of values from specific object",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"\"Nigel Rees\"",
|
||||
"\"Evelyn Waugh\"",
|
||||
"\"Herman Melville\"",
|
||||
"\"J. R. R. Tolkien\""
|
||||
].join("\n"),
|
||||
expectedOutput: ['"Nigel Rees"', '"Evelyn Waugh"', '"Herman Melville"', '"J. R. R. Tolkien"'].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$.store.book[*].author", "\n", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: Fetch of all values with matching key",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"\"Sayings of the Century\"",
|
||||
"\"Sword of Honour\"",
|
||||
"\"Moby Dick\"",
|
||||
"\"The Lord of the Rings\"",
|
||||
"\"Financial Times\"",
|
||||
"\"The Guardian\""
|
||||
'"Sayings of the Century"',
|
||||
'"Sword of Honour"',
|
||||
'"Moby Dick"',
|
||||
'"The Lord of the Rings"',
|
||||
'"Financial Times"',
|
||||
'"The Guardian"'
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$..title", "\n", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: All data in object",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":\"Sayings of the Century\",\"price\":8.95},{\"category\":\"fiction\",\"author\":\"Evelyn Waugh\",\"title\":\"Sword of Honour\",\"price\":12.99},{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99},{\"category\":\"fiction\",\"author\":\"J. R. R. Tolkien\",\"title\":\"The Lord of the Rings\",\"isbn\":\"0-395-19395-8\",\"price\":22.99}]",
|
||||
"{\"color\":\"red\",\"price\":19.95}",
|
||||
"[{\"format\":\"broadsheet\",\"title\":\"Financial Times\",\"price\":2.75},{\"format\":\"tabloid\",\"title\":\"The Guardian\",\"price\":2}]"
|
||||
'[{"category":"reference","author":"Nigel Rees","title":"Sayings of the Century","price":8.95},{"category":"fiction","author":"Evelyn Waugh","title":"Sword of Honour","price":12.99},{"category":"fiction","author":"Herman Melville","title":"Moby Dick","isbn":"0-553-21311-3","price":8.99},{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}]',
|
||||
'{"color":"red","price":19.95}',
|
||||
'[{"format":"broadsheet","title":"Financial Times","price":2.75},{"format":"tabloid","title":"The Guardian","price":2}]'
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$.store.*", "\n", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: Last element in array",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: "{\"category\":\"fiction\",\"author\":\"J. R. R. Tolkien\",\"title\":\"The Lord of the Rings\",\"isbn\":\"0-395-19395-8\",\"price\":22.99}",
|
||||
expectedOutput:
|
||||
'{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}',
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$..book[-1:]", "\n", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: First 2 elements in array",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":\"Sayings of the Century\",\"price\":8.95}",
|
||||
"{\"category\":\"fiction\",\"author\":\"Evelyn Waugh\",\"title\":\"Sword of Honour\",\"price\":12.99}"
|
||||
'{"category":"reference","author":"Nigel Rees","title":"Sayings of the Century","price":8.95}',
|
||||
'{"category":"fiction","author":"Evelyn Waugh","title":"Sword of Honour","price":12.99}'
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$..book[:2]", "\n", true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: All elements in array with property",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99}",
|
||||
"{\"category\":\"fiction\",\"author\":\"J. R. R. Tolkien\",\"title\":\"The Lord of the Rings\",\"isbn\":\"0-395-19395-8\",\"price\":22.99}"
|
||||
'{"category":"fiction","author":"Herman Melville","title":"Moby Dick","isbn":"0-553-21311-3","price":8.99}',
|
||||
'{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}'
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$..book[?(@.isbn)]", "\n", false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: All elements in array which meet condition",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"{\"category\":\"fiction\",\"author\":\"Evelyn Waugh\",\"title\":\"Sword of Honour\",\"price\":12.99}",
|
||||
"{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99}",
|
||||
"{\"category\":\"fiction\",\"author\":\"J. R. R. Tolkien\",\"title\":\"The Lord of the Rings\",\"isbn\":\"0-395-19395-8\",\"price\":22.99}"
|
||||
'{"category":"fiction","author":"Evelyn Waugh","title":"Sword of Honour","price":12.99}',
|
||||
'{"category":"fiction","author":"Herman Melville","title":"Moby Dick","isbn":"0-553-21311-3","price":8.99}',
|
||||
'{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}'
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$..book[?(@.price<30 && @.category==\"fiction\")]", "\n", false]
|
||||
"args": ['$..book[?(@.price<30 && @.category=="fiction")]', "\n", false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: All elements in object",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: [
|
||||
"{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":\"Sayings of the Century\",\"price\":8.95}",
|
||||
"{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99}"
|
||||
'{"category":"reference","author":"Nigel Rees","title":"Sayings of the Century","price":8.95}',
|
||||
'{"category":"fiction","author":"Herman Melville","title":"Moby Dick","isbn":"0-553-21311-3","price":8.99}'
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "JPath expression",
|
||||
"args": ["$..book[?(@.price<10)]", "\n", false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JPath Expression: Script-based expression",
|
||||
|
@ -343,7 +347,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "XPath expression",
|
||||
"args": ["/div/p[@class=\"a\"]", "\\n"]
|
||||
"args": ['/div/p[@class="a"]', "\\n"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -376,7 +380,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "To MessagePack: valid json",
|
||||
input: JSON.stringify(JSON_TEST_DATA),
|
||||
expectedOutput: "81 a5 73 74 6f 72 65 83 a4 62 6f 6f 6b 94 84 a8 63 61 74 65 67 6f 72 79 a9 72 65 66 65 72 65 6e 63 65 a6 61 75 74 68 6f 72 aa 4e 69 67 65 6c 20 52 65 65 73 a5 74 69 74 6c 65 b6 53 61 79 69 6e 67 73 20 6f 66 20 74 68 65 20 43 65 6e 74 75 72 79 a5 70 72 69 63 65 cb 40 21 e6 66 66 66 66 66 84 a8 63 61 74 65 67 6f 72 79 a7 66 69 63 74 69 6f 6e a6 61 75 74 68 6f 72 ac 45 76 65 6c 79 6e 20 57 61 75 67 68 a5 74 69 74 6c 65 af 53 77 6f 72 64 20 6f 66 20 48 6f 6e 6f 75 72 a5 70 72 69 63 65 cb 40 29 fa e1 47 ae 14 7b 85 a8 63 61 74 65 67 6f 72 79 a7 66 69 63 74 69 6f 6e a6 61 75 74 68 6f 72 af 48 65 72 6d 61 6e 20 4d 65 6c 76 69 6c 6c 65 a5 74 69 74 6c 65 a9 4d 6f 62 79 20 44 69 63 6b a4 69 73 62 6e ad 30 2d 35 35 33 2d 32 31 33 31 31 2d 33 a5 70 72 69 63 65 cb 40 21 fa e1 47 ae 14 7b 85 a8 63 61 74 65 67 6f 72 79 a7 66 69 63 74 69 6f 6e a6 61 75 74 68 6f 72 b0 4a 2e 20 52 2e 20 52 2e 20 54 6f 6c 6b 69 65 6e a5 74 69 74 6c 65 b5 54 68 65 20 4c 6f 72 64 20 6f 66 20 74 68 65 20 52 69 6e 67 73 a4 69 73 62 6e ad 30 2d 33 39 35 2d 31 39 33 39 35 2d 38 a5 70 72 69 63 65 cb 40 36 fd 70 a3 d7 0a 3d a7 62 69 63 79 63 6c 65 82 a5 63 6f 6c 6f 72 a3 72 65 64 a5 70 72 69 63 65 cb 40 33 f3 33 33 33 33 33 a9 6e 65 77 73 70 61 70 65 72 92 83 a6 66 6f 72 6d 61 74 aa 62 72 6f 61 64 73 68 65 65 74 a5 74 69 74 6c 65 af 46 69 6e 61 6e 63 69 61 6c 20 54 69 6d 65 73 a5 70 72 69 63 65 cb 40 06 00 00 00 00 00 00 83 a6 66 6f 72 6d 61 74 a7 74 61 62 6c 6f 69 64 a5 74 69 74 6c 65 ac 54 68 65 20 47 75 61 72 64 69 61 6e a5 70 72 69 63 65 02",
|
||||
expectedOutput:
|
||||
"81 a5 73 74 6f 72 65 83 a4 62 6f 6f 6b 94 84 a8 63 61 74 65 67 6f 72 79 a9 72 65 66 65 72 65 6e 63 65 a6 61 75 74 68 6f 72 aa 4e 69 67 65 6c 20 52 65 65 73 a5 74 69 74 6c 65 b6 53 61 79 69 6e 67 73 20 6f 66 20 74 68 65 20 43 65 6e 74 75 72 79 a5 70 72 69 63 65 cb 40 21 e6 66 66 66 66 66 84 a8 63 61 74 65 67 6f 72 79 a7 66 69 63 74 69 6f 6e a6 61 75 74 68 6f 72 ac 45 76 65 6c 79 6e 20 57 61 75 67 68 a5 74 69 74 6c 65 af 53 77 6f 72 64 20 6f 66 20 48 6f 6e 6f 75 72 a5 70 72 69 63 65 cb 40 29 fa e1 47 ae 14 7b 85 a8 63 61 74 65 67 6f 72 79 a7 66 69 63 74 69 6f 6e a6 61 75 74 68 6f 72 af 48 65 72 6d 61 6e 20 4d 65 6c 76 69 6c 6c 65 a5 74 69 74 6c 65 a9 4d 6f 62 79 20 44 69 63 6b a4 69 73 62 6e ad 30 2d 35 35 33 2d 32 31 33 31 31 2d 33 a5 70 72 69 63 65 cb 40 21 fa e1 47 ae 14 7b 85 a8 63 61 74 65 67 6f 72 79 a7 66 69 63 74 69 6f 6e a6 61 75 74 68 6f 72 b0 4a 2e 20 52 2e 20 52 2e 20 54 6f 6c 6b 69 65 6e a5 74 69 74 6c 65 b5 54 68 65 20 4c 6f 72 64 20 6f 66 20 74 68 65 20 52 69 6e 67 73 a4 69 73 62 6e ad 30 2d 33 39 35 2d 31 39 33 39 35 2d 38 a5 70 72 69 63 65 cb 40 36 fd 70 a3 d7 0a 3d a7 62 69 63 79 63 6c 65 82 a5 63 6f 6c 6f 72 a3 72 65 64 a5 70 72 69 63 65 cb 40 33 f3 33 33 33 33 33 a9 6e 65 77 73 70 61 70 65 72 92 83 a6 66 6f 72 6d 61 74 aa 62 72 6f 61 64 73 68 65 65 74 a5 74 69 74 6c 65 af 46 69 6e 61 6e 63 69 61 6c 20 54 69 6d 65 73 a5 70 72 69 63 65 cb 40 06 00 00 00 00 00 00 83 a6 66 6f 72 6d 61 74 a7 74 61 62 6c 6f 69 64 a5 74 69 74 6c 65 ac 54 68 65 20 47 75 61 72 64 69 61 6e a5 70 72 69 63 65 02",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "To MessagePack",
|
||||
|
|
|
@ -17,23 +17,65 @@ TestRegister.addTests([
|
|||
"args": [
|
||||
"",
|
||||
"KH Pattern",
|
||||
"Z", "", "",
|
||||
"None", "Select Program", "Letter Count",
|
||||
"Z",
|
||||
"",
|
||||
"",
|
||||
"None",
|
||||
"Select Program",
|
||||
"Letter Count",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"", "", "", "", "", false, "",
|
||||
"", "", "", "", "", false, "",
|
||||
"", "", "", "", "", false, "",
|
||||
false,
|
||||
"",
|
||||
false, false, false, false, false,
|
||||
"", false, false, "",
|
||||
"",
|
||||
0, "", "",
|
||||
"1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
false,
|
||||
"",
|
||||
false,
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
false,
|
||||
false,
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
"1"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
// Takes a while to run, so disabling for general purpose testing. Re-enable if modifying this operation.
|
||||
// {
|
||||
// name: "Colossus 1+2=.",
|
||||
|
|
|
@ -24,7 +24,7 @@ const ALL_BYTES = [
|
|||
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
|
||||
"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
|
||||
"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
|
||||
].join("");
|
||||
|
||||
TestRegister.addTests([
|
||||
|
|
|
@ -21,7 +21,7 @@ TestRegister.addTests([
|
|||
"op": "Bzip2 Decompress",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LZMA compress & decompress",
|
||||
|
@ -36,8 +36,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "LZMA Decompress",
|
||||
"args": []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LZMA decompress: binary",
|
||||
|
@ -57,7 +57,7 @@ TestRegister.addTests([
|
|||
"op": "To Hex",
|
||||
"args": ["Space", 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LZMA decompress: string",
|
||||
|
@ -73,7 +73,7 @@ TestRegister.addTests([
|
|||
"op": "LZMA Decompress",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LZ4 Compress",
|
||||
|
@ -88,7 +88,7 @@ TestRegister.addTests([
|
|||
"op": "To Hex",
|
||||
"args": ["None", 0]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LZ4 Decompress",
|
||||
|
@ -103,6 +103,6 @@ TestRegister.addTests([
|
|||
"op": "LZ4 Decompress",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,83 +11,72 @@ import TestRegister from "../../lib/TestRegister.mjs";
|
|||
TestRegister.addTests([
|
||||
{
|
||||
name: "Conditional Jump: Skips 0",
|
||||
input: [
|
||||
"should be changed",
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"YzJodmRXeGtJR0psSUdOb1lXNW5aV1E9"
|
||||
].join("\n"),
|
||||
input: ["should be changed"].join("\n"),
|
||||
expectedOutput: ["YzJodmRXeGtJR0psSUdOb1lXNW5aV1E9"].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Conditional Jump",
|
||||
args: ["match", false, "", 0],
|
||||
args: ["match", false, "", 0]
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Conditional Jump: Skips 1",
|
||||
input: [
|
||||
"should be changed",
|
||||
].join("\n"),
|
||||
input: ["should be changed"].join("\n"),
|
||||
// Expecting base32, not base64 output
|
||||
expectedOutput: [
|
||||
"ONUG65LMMQQGEZJAMNUGC3THMVSA====",
|
||||
].join("\n"),
|
||||
expectedOutput: ["ONUG65LMMQQGEZJAMNUGC3THMVSA===="].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Conditional Jump",
|
||||
args: ["should", false, "skip match", 10],
|
||||
args: ["should", false, "skip match", 10]
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
},
|
||||
{
|
||||
op: "Label", args: ["skip match"],
|
||||
op: "Label",
|
||||
args: ["skip match"]
|
||||
},
|
||||
{
|
||||
op: "To Base32",
|
||||
args: ["A-Z2-7="],
|
||||
},
|
||||
],
|
||||
args: ["A-Z2-7="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Conditional Jump: Skips backwards",
|
||||
input: [
|
||||
"match",
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"f7cf556f7f4fc6635db8c314f7a81f2a",
|
||||
].join("\n"),
|
||||
input: ["match"].join("\n"),
|
||||
expectedOutput: ["f7cf556f7f4fc6635db8c314f7a81f2a"].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Label",
|
||||
args: ["back to the beginning"],
|
||||
args: ["back to the beginning"]
|
||||
},
|
||||
{
|
||||
op: "Jump",
|
||||
args: ["skip replace"],
|
||||
args: ["skip replace"]
|
||||
},
|
||||
{
|
||||
op: "MD2",
|
||||
args: [],
|
||||
args: []
|
||||
},
|
||||
{
|
||||
op: "Label",
|
||||
args: ["skip replace"],
|
||||
args: ["skip replace"]
|
||||
},
|
||||
{
|
||||
op: "Conditional Jump",
|
||||
args: ["match", false, "back to the beginning", 10],
|
||||
},
|
||||
],
|
||||
args: ["match", false, "back to the beginning", 10]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -29,8 +29,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Degrees Minutes Seconds", "Comma", "None", 1]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From Degrees Minutes Seconds to Decimal Degrees",
|
||||
|
@ -40,8 +40,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Degrees Minutes Seconds", "Comma", "Decimal Degrees", "Comma", "None", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From Decimal Degrees to Degrees Decimal Minutes",
|
||||
|
@ -84,8 +84,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Geohash", "Comma", "None", 9]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From Geohash to Decimal Degrees",
|
||||
|
@ -95,8 +95,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Geohash", "Comma", "Decimal Degrees", "Comma", "None", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From Decimal Degrees to MGRS",
|
||||
|
@ -106,8 +106,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Military Grid Reference System", "Comma", "None", 10]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From MGRS to Decimal Degrees",
|
||||
|
@ -128,8 +128,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Ordnance Survey National Grid", "Comma", "None", 10]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From OSNG to Decimal Degrees",
|
||||
|
@ -139,8 +139,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Ordnance Survey National Grid", "Comma", "Decimal Degrees", "Comma", "None", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From Decimal Degrees to UTM",
|
||||
|
@ -150,8 +150,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Universal Transverse Mercator", "Comma", "None", 0]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: From UTM to Decimal Degrees",
|
||||
|
@ -161,8 +161,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Universal Transverse Mercator", "Comma", "Decimal Degrees", "Comma", "None", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: Directions in input, not output",
|
||||
|
@ -172,8 +172,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Decimal Degrees", "Comma", "None", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: Directions in input and output",
|
||||
|
@ -183,8 +183,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Decimal Degrees", "Comma", "Before", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: Directions not in input, in output",
|
||||
|
@ -194,8 +194,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Decimal Degrees", "Comma", "Before", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Co-ordinates: Directions not in input, in converted output",
|
||||
|
@ -205,7 +205,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Convert co-ordinate format",
|
||||
args: ["Decimal Degrees", "Comma", "Degrees Minutes Seconds", "Comma", "Before", 3]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -21,7 +21,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Convert to NATO alphabet: full alphabet with numbers",
|
||||
input: "abcdefghijklmnopqrstuvwxyz0123456789,/.",
|
||||
expectedOutput: "Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliett Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey X-ray Yankee Zulu Zero One Two Three Four Five Six Seven Eight Nine Comma Fraction bar Full stop ",
|
||||
expectedOutput:
|
||||
"Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliett Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey X-ray Yankee Zulu Zero One Two Three Four Five Six Seven Eight Nine Comma Fraction bar Full stop ",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Convert to NATO alphabet",
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Windows Filetime to UNIX Timestamp",
|
||||
args: ["Nanoseconds (ns)", "Decimal"],
|
||||
},
|
||||
],
|
||||
args: ["Nanoseconds (ns)", "Decimal"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Unix to Filetime",
|
||||
|
@ -27,8 +27,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "UNIX Timestamp to Windows Filetime",
|
||||
args: ["Nanoseconds (ns)", "Decimal"],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["Nanoseconds (ns)", "Decimal"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,28 +16,30 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Defang IP Addresses",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Defang IP: Valid IPV6",
|
||||
input: "2001:0db8:85a3:0000:0000:8a2e:0370:7343",
|
||||
expectedOutput: "2001[:]0db8[:]85a3[:]0000[:]0000[:]8a2e[:]0370[:]7343",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Defang IP Addresses",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Defang IP: Valid IPV6 Shorthand",
|
||||
input: "2001:db8:3c4d:15::1a2f:1a2b",
|
||||
expectedOutput: "2001[:]db8[:]3c4d[:]15[:][:]1a2f[:]1a2b",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Defang IP Addresses",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -4,12 +4,16 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
import {ELF32_LE, ELF32_BE, ELF64_LE, ELF64_BE} from "../../samples/Executables.mjs";
|
||||
import { ELF32_LE, ELF32_BE, ELF64_LE, ELF64_BE } from "../../samples/Executables.mjs";
|
||||
|
||||
const ELF32_LE_OUTPUT = "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 32-bit\nEndianness: Little\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: x86\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x34\nEntry SHOFF: 0x54\nFlags: 00000000\nELF Header Size: 52 bytes\nProgram Header Size: 32 bytes\nProgram Header Entries: 1\nSection Header Size: 40 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\nFlags: Execute,Read\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 204\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 230\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 245\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF32_BE_OUTPUT = "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 32-bit\nEndianness: Big\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: x86\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x34\nEntry SHOFF: 0x54\nFlags: 00000000\nELF Header Size: 52 bytes\nProgram Header Size: 32 bytes\nProgram Header Entries: 1\nSection Header Size: 40 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\nFlags: Execute,Read\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 204\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 230\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 245\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF64_LE_OUTPUT = "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 64-bit\nEndianness: Little\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: AMD x86-64\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x40\nEntry SHOFF: 0x78\nFlags: 00000000\nELF Header Size: 64 bytes\nProgram Header Size: 56 bytes\nProgram Header Entries: 1\nSection Header Size: 64 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nFlags: Execute,Read\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 312\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 336\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 361\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF64_BE_OUTPUT = "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 64-bit\nEndianness: Big\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: AMD x86-64\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x40\nEntry SHOFF: 0x78\nFlags: 00000000\nELF Header Size: 64 bytes\nProgram Header Size: 56 bytes\nProgram Header Entries: 1\nSection Header Size: 64 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nFlags: Execute,Read\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 312\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 336\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 361\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF32_LE_OUTPUT
|
||||
= "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 32-bit\nEndianness: Little\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: x86\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x34\nEntry SHOFF: 0x54\nFlags: 00000000\nELF Header Size: 52 bytes\nProgram Header Size: 32 bytes\nProgram Header Entries: 1\nSection Header Size: 40 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\nFlags: Execute,Read\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 204\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 230\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 245\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF32_BE_OUTPUT
|
||||
= "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 32-bit\nEndianness: Big\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: x86\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x34\nEntry SHOFF: 0x54\nFlags: 00000000\nELF Header Size: 52 bytes\nProgram Header Size: 32 bytes\nProgram Header Entries: 1\nSection Header Size: 40 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\nFlags: Execute,Read\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 204\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 230\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 245\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF64_LE_OUTPUT
|
||||
= "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 64-bit\nEndianness: Little\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: AMD x86-64\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x40\nEntry SHOFF: 0x78\nFlags: 00000000\nELF Header Size: 64 bytes\nProgram Header Size: 56 bytes\nProgram Header Entries: 1\nSection Header Size: 64 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nFlags: Execute,Read\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 312\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 336\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 361\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
const ELF64_BE_OUTPUT
|
||||
= "============================== ELF Header ==============================\nMagic: \x7fELF\nFormat: 64-bit\nEndianness: Big\nVersion: 1\nABI: System V\nABI Version: 0\nType: Executable File\nInstruction Set Architecture: AMD x86-64\nELF Version: 1\nEntry Point: 0x8062150\nEntry PHOFF: 0x40\nEntry SHOFF: 0x78\nFlags: 00000000\nELF Header Size: 64 bytes\nProgram Header Size: 56 bytes\nProgram Header Entries: 1\nSection Header Size: 64 bytes\nSection Header Entries: 3\nSection Header Names: 0\n\n============================== Program Header ==============================\nProgram Header Type: Program Header Table\nFlags: Execute,Read\nOffset Of Segment: 52\nVirtual Address of Segment: 134512692\nPhysical Address of Segment: 134512692\nSize of Segment: 256 bytes\nSize of Segment in Memory: 256 bytes\n\n============================== Section Header ==============================\nType: String Table\nSection Name: .shstrab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 312\nSection Size: 28\nAssociated Section: 0\nSection Extra Information: 0\n\nType: Symbol Table\nSection Name: .symtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 336\nSection Size: 16\nAssociated Section: 0\nSection Extra Information: 0\n\nType: String Table\nSection Name: .strtab\nFlags: \nSection Vaddr in memory: 0\nOffset of the section: 361\nSection Size: 4\nAssociated Section: 0\nSection Extra Information: 0\n\n============================== Symbol Table ==============================\nSymbol Name: test";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
@ -19,9 +23,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "ELF Info",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ELF Info 32-bit ELF Little Endian.",
|
||||
|
@ -30,13 +34,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"],
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "ELF Info",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ELF Info 32-bit ELF Big Endian.",
|
||||
|
@ -45,13 +49,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"],
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "ELF Info",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ELF Info 64-bit ELF Little Endian.",
|
||||
|
@ -60,13 +64,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"],
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "ELF Info",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "ELF Info 64-bit ELF Big Endian.",
|
||||
|
@ -75,12 +79,12 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"],
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "ELF Info",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -18,11 +18,19 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
// Note: start on Z because it steps when the key is pressed
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "Z", // III
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"Z", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
""
|
||||
]
|
||||
|
@ -40,10 +48,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "N",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "F",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "W",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"N",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"F",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"W",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -62,10 +78,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "B", "Z",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"B",
|
||||
"Z",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -83,10 +107,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "N", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "F", "A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "W", "Z",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"N",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"F",
|
||||
"A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"W",
|
||||
"Z",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -104,10 +136,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "Z",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"Z",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -124,10 +164,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "Z",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"Z",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -136,10 +184,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "Z",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"Z",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -157,10 +213,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "D",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "U",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"D",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"U",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -178,10 +242,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "E",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "U",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"E",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"U",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -199,10 +271,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "D",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "S",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"D",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"S",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -219,10 +299,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "H", "Z",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"H",
|
||||
"Z",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -239,10 +327,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "Q", "A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "C", "D",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "H", "F",
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"Q",
|
||||
"A",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"C",
|
||||
"D",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"H",
|
||||
"F",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW",
|
||||
""
|
||||
]
|
||||
|
@ -259,10 +355,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"4-rotor",
|
||||
"LEYJVCNIXWPBQMDRTAKZGFUHOS", "A", "X", // Beta
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "O", "E",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "P", "F",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "D", "Q",
|
||||
"LEYJVCNIXWPBQMDRTAKZGFUHOS",
|
||||
"A",
|
||||
"X", // Beta
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"O",
|
||||
"E",
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"P",
|
||||
"F",
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"D",
|
||||
"Q",
|
||||
"AE BN CK DQ FU GY HW IJ LO MP RX SZ TV", // B thin
|
||||
""
|
||||
]
|
||||
|
@ -279,10 +383,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"4-rotor",
|
||||
"FSOKANUERHMBTIYCWLQPZXVGJD", "A", "L", // Gamma
|
||||
"JPGVOUMFYQBENHZRDKASXLICTW<AN", "A", "J", // VI
|
||||
"VZBRGITYUPSDNHLXAWMJQOFECK<A", "M", "G", // V
|
||||
"ESOVPZJAYQUIRHXLNFTGKDCMWB<K", "W", "U", // IV
|
||||
"FSOKANUERHMBTIYCWLQPZXVGJD",
|
||||
"A",
|
||||
"L", // Gamma
|
||||
"JPGVOUMFYQBENHZRDKASXLICTW<AN",
|
||||
"A",
|
||||
"J", // VI
|
||||
"VZBRGITYUPSDNHLXAWMJQOFECK<A",
|
||||
"M",
|
||||
"G", // V
|
||||
"ESOVPZJAYQUIRHXLNFTGKDCMWB<K",
|
||||
"W",
|
||||
"U", // IV
|
||||
"AR BD CO EJ FN GT HK IV LM PW QZ SX UY", // C thin
|
||||
""
|
||||
]
|
||||
|
@ -299,10 +411,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"4-rotor",
|
||||
"FSOKANUERHMBTIYCWLQPZXVGJD", "A", "I", // Gamma
|
||||
"NZJHGRCXMYSWBOUFAIVLPEKQDT<AN", "I", "V", // VII
|
||||
"ESOVPZJAYQUIRHXLNFTGKDCMWB<K", "O", "O", // IV
|
||||
"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN", "U", "Z", // VIII
|
||||
"FSOKANUERHMBTIYCWLQPZXVGJD",
|
||||
"A",
|
||||
"I", // Gamma
|
||||
"NZJHGRCXMYSWBOUFAIVLPEKQDT<AN",
|
||||
"I",
|
||||
"V", // VII
|
||||
"ESOVPZJAYQUIRHXLNFTGKDCMWB<K",
|
||||
"O",
|
||||
"O", // IV
|
||||
"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN",
|
||||
"U",
|
||||
"Z", // VIII
|
||||
"AE BN CK DQ FU GY HW IJ LO MP RX SZ TV", // B thin
|
||||
"WN MJ LX YB FP QD US IH CE GR"
|
||||
]
|
||||
|
@ -319,10 +439,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"4-rotor",
|
||||
"FSOKANUERHMBTIYCWLQPZXVGJD", "A", "I", // Gamma
|
||||
"NZJHGRCXMYSWBOUFAIVLPEKQDT<AN", "I", "V", // VII
|
||||
"ESOVPZJAYQUIRHXLNFTGKDCMWB<K", "O", "O", // IV
|
||||
"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN", "U", "Z", // VIII
|
||||
"FSOKANUERHMBTIYCWLQPZXVGJD",
|
||||
"A",
|
||||
"I", // Gamma
|
||||
"NZJHGRCXMYSWBOUFAIVLPEKQDT<AN",
|
||||
"I",
|
||||
"V", // VII
|
||||
"ESOVPZJAYQUIRHXLNFTGKDCMWB<K",
|
||||
"O",
|
||||
"O", // IV
|
||||
"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN",
|
||||
"U",
|
||||
"Z", // VIII
|
||||
"AE BN CK DQ FU GY HW IJ LO MP RX SZ TV", // B thin
|
||||
"WN MJ LX YB FP QD US IH CE GR"
|
||||
]
|
||||
|
@ -333,16 +461,25 @@ TestRegister.addTests([
|
|||
// Decryption test on real message
|
||||
name: "Enigma: decryption 2",
|
||||
input: "LANOTCTOUARBBFPMHPHGCZXTDYGAHGUFXGEWKBLKGJWLQXXTGPJJAVTOCKZFSLPPQIHZFXOEBWIIEKFZLCLOAQJULJOYHSSMBBGWHZANVOIIPYRBRTDJQDJJOQKCXWDNBBTYVXLYTAPGVEATXSONPNYNQFUDBBHHVWEPYEYDOHNLXKZDNWRHDUWUJUMWWVIIWZXIVIUQDRHYMNCYEFUAPNHOTKHKGDNPSAKNUAGHJZSMJBMHVTREQEDGXHLZWIFUSKDQVELNMIMITHBHDBWVHDFYHJOQIHORTDJDBWXEMEAYXGYQXOHFDMYUXXNOJAZRSGHPLWMLRECWWUTLRTTVLBHYOORGLGOWUXNXHMHYFAACQEKTHSJW",
|
||||
expectedOutput: "KRKRALLEXXFOLGENDESISTSOFORTBEKANNTZUGEBENXXICHHABEFOLGELNBEBEFEHLERHALTENXXJANSTERLEDESBISHERIGXNREICHSMARSCHALLSJGOERINGJSETZTDERFUEHRERSIEYHVRRGRZSSADMIRALYALSSEINENNACHFOLGEREINXSCHRIFTLSCHEVOLLMACHTUNTERWEGSXABSOFORTSOLLENSIESAEMTLICHEMASSNAHMENVERFUEGENYDIESICHAUSDERGEGENWAERTIGENLAGEERGEBENXGEZXREICHSLEITEIKKTULPEKKJBORMANNJXXOBXDXMMMDURNHFKSTXKOMXADMXUUUBOOIEXKP",
|
||||
expectedOutput:
|
||||
"KRKRALLEXXFOLGENDESISTSOFORTBEKANNTZUGEBENXXICHHABEFOLGELNBEBEFEHLERHALTENXXJANSTERLEDESBISHERIGXNREICHSMARSCHALLSJGOERINGJSETZTDERFUEHRERSIEYHVRRGRZSSADMIRALYALSSEINENNACHFOLGEREINXSCHRIFTLSCHEVOLLMACHTUNTERWEGSXABSOFORTSOLLENSIESAEMTLICHEMASSNAHMENVERFUEGENYDIESICHAUSDERGEGENWAERTIGENLAGEERGEBENXGEZXREICHSLEITEIKKTULPEKKJBORMANNJXXOBXDXMMMDURNHFKSTXKOMXADMXUUUBOOIEXKP",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Enigma",
|
||||
"args": [
|
||||
"4-rotor",
|
||||
"LEYJVCNIXWPBQMDRTAKZGFUHOS", "E", "C", // Beta
|
||||
"VZBRGITYUPSDNHLXAWMJQOFECK<A", "P", "D", // V
|
||||
"JPGVOUMFYQBENHZRDKASXLICTW<AN", "E", "S", // VI
|
||||
"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN", "L", "Z", // VIII
|
||||
"LEYJVCNIXWPBQMDRTAKZGFUHOS",
|
||||
"E",
|
||||
"C", // Beta
|
||||
"VZBRGITYUPSDNHLXAWMJQOFECK<A",
|
||||
"P",
|
||||
"D", // V
|
||||
"JPGVOUMFYQBENHZRDKASXLICTW<AN",
|
||||
"E",
|
||||
"S", // VI
|
||||
"FKQHTLXOCBJSPDZRAMEWNIUYGV<AN",
|
||||
"L",
|
||||
"Z", // VIII
|
||||
"AR BD CO EJ FN GT HK IV LM PW QZ SX UY", // C thin
|
||||
"AE BF CM DQ HU JN LX PR SZ VW"
|
||||
]
|
||||
|
@ -359,12 +496,21 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"", true
|
||||
"",
|
||||
true
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -379,12 +525,21 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"", false
|
||||
"",
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -398,10 +553,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQ", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQ",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
""
|
||||
]
|
||||
|
@ -417,10 +580,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQo", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQo",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
""
|
||||
]
|
||||
|
@ -436,10 +607,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQA", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQA",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
""
|
||||
]
|
||||
|
@ -455,10 +634,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<RR", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<RR",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
""
|
||||
]
|
||||
|
@ -474,10 +661,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<a", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<a",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
""
|
||||
]
|
||||
|
@ -495,10 +690,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO", // B
|
||||
""
|
||||
]
|
||||
|
@ -514,10 +717,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"A", // III
|
||||
"AA BR CU DH EQ FS GL IP JX KN MO TZ VV WY", // B
|
||||
""
|
||||
]
|
||||
|
@ -533,10 +744,18 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"A", // III
|
||||
"AY AR CU DH EQ FS GL IP JX KN MO TZ", // B
|
||||
""
|
||||
]
|
||||
|
@ -552,14 +771,22 @@ TestRegister.addTests([
|
|||
"op": "Enigma",
|
||||
"args": [
|
||||
"3-rotor",
|
||||
"", "A", "A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R", "A", "A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F", "A", "A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W", "A", "A", // III
|
||||
"",
|
||||
"A",
|
||||
"A",
|
||||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R",
|
||||
"A",
|
||||
"A", // I
|
||||
"AJDKSIRUXBLHWTMCQGZNPYFVOE<F",
|
||||
"A",
|
||||
"A", // II
|
||||
"BDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"A",
|
||||
"A", // III
|
||||
"AYBR CU DH EQ FS GL IP JX KN MO TZ", // B
|
||||
""
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,45 +11,49 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Extract email address",
|
||||
input: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com email@example.name\nemail@example.museum email@example.co.jp firstname-lastname@example.com",
|
||||
expectedOutput: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com",
|
||||
expectedOutput:
|
||||
"email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Extract email addresses",
|
||||
"args": [false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract email address - Display total",
|
||||
input: "email@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com email@example.name\nemail@example.museum email@example.co.jp firstname-lastname@example.com",
|
||||
expectedOutput: "Total found: 11\n\nemail@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com",
|
||||
expectedOutput:
|
||||
"Total found: 11\n\nemail@example.com\nfirstname.lastname@example.com\nemail@subdomain.example.com\nfirstname+lastname@example.com\n1234567890@example.com\nemail@example-one.com\n_______@example.com\nemail@example.name\nemail@example.museum\nemail@example.co.jp\nfirstname-lastname@example.com",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Extract email addresses",
|
||||
"args": [true]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract email address (Internationalized)",
|
||||
input: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9 \u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c \u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc Jos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com and Jos\u1ec5Silva@google.com\nFoO@BaR.CoM, john@192.168.10.100\ng\xf3mez@junk.br and Abc.123@example.com.\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
|
||||
expectedOutput: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
|
||||
expectedOutput:
|
||||
"\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Extract email addresses",
|
||||
"args": [false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract email address - Display total (Internationalized)",
|
||||
input: "\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9 \u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c \u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc Jos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com and Jos\u1ec5Silva@google.com\nFoO@BaR.CoM, john@192.168.10.100\ng\xf3mez@junk.br and Abc.123@example.com.\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
|
||||
expectedOutput: "Total found: 19\n\n\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
|
||||
expectedOutput:
|
||||
"Total found: 19\n\n\u4f0a\u662d\u5091@\u90f5\u4ef6.\u5546\u52d9\n\u093e\u092e@\u092e\u094b\u0939\u0928.\u0908\u0928\u094d\u092b\u094b\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nJos\u1ec5Silv\u1ec5@googl\u1ec5.com\nJos\u1ec5Silv\u1ec5@google.com\nJos\u1ec5Silva@google.com\nFoO@BaR.CoM\njohn@192.168.10.100\ng\xf3mez@junk.br\nAbc.123@example.com\nuser+mailbox/department=shipping@example.com\n\u7528\u6237@\u4f8b\u5b50.\u5e7f\u544a\n\u0909\u092a\u092f\u094b\u0917\u0915\u0930\u094d\u0924\u093e@\u0909\u0926\u093e\u0939\u0930\u0923.\u0915\u0949\u092e\n\u044e\u0437\u0435\u0440@\u0435\u043a\u0437\u0430\u043c\u043f\u043b.\u043a\u043e\u043c\n\u03b8\u03c3\u03b5\u03c1@\u03b5\u03c7\u03b1\u03bc\u03c0\u03bb\u03b5.\u03c8\u03bf\u03bc\nD\xf6rte@S\xf6rensen.example.com\n\u0430\u0434\u0436\u0430\u0439@\u044d\u043a\u0437\u0430\u043c\u043f\u043b.\u0440\u0443\u0441\ntest@xn--bcher-kva.com",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Extract email addresses",
|
||||
"args": [true]
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
op: "Fernet Decrypt",
|
||||
args: ["MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI="]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fernet Decrypt: no secret",
|
||||
|
@ -28,7 +28,7 @@ TestRegister.addTests([
|
|||
op: "Fernet Decrypt",
|
||||
args: [""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fernet Decrypt: valid arguments",
|
||||
|
@ -39,7 +39,7 @@ TestRegister.addTests([
|
|||
op: "Fernet Decrypt",
|
||||
args: ["VGhpc0lzVGhpcnR5VHdvQ2hhcmFjdGVyc0xvbmdLZXk="]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
|
@ -53,7 +53,7 @@ TestRegister.addTests([
|
|||
op: "Fernet Encrypt",
|
||||
args: ["MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI="]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fernet Encrypt: no secret",
|
||||
|
@ -64,7 +64,7 @@ TestRegister.addTests([
|
|||
op: "Fernet Encrypt",
|
||||
args: [""]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fernet Encrypt: valid arguments",
|
||||
|
@ -75,6 +75,6 @@ TestRegister.addTests([
|
|||
op: "Fernet Encrypt",
|
||||
args: ["MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI="]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -15,8 +15,8 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "File Tree",
|
||||
"args": ["/", "Line feed"],
|
||||
},
|
||||
],
|
||||
"args": ["/", "Line feed"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -13,9 +13,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-16 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-16 Checksum: abcdef",
|
||||
|
@ -24,9 +24,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-16 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-16 Checksum: abcdefgh",
|
||||
|
@ -35,9 +35,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-16 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-32 Checksum: abcde",
|
||||
|
@ -46,9 +46,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-32 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-32 Checksum: abcdef",
|
||||
|
@ -57,9 +57,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-32 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-32 Checksum: abcdefgh",
|
||||
|
@ -68,9 +68,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-32 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-64 Checksum: abcde",
|
||||
|
@ -79,9 +79,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-64 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-64 Checksum: abcdef",
|
||||
|
@ -90,9 +90,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-64 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fletcher-64 Checksum: abcdefgh",
|
||||
|
@ -101,8 +101,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fletcher-64 Checksum",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fork",
|
||||
args: ["\n", "\n", false],
|
||||
},
|
||||
],
|
||||
args: ["\n", "\n", false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fork, Merge: nothing",
|
||||
|
@ -27,44 +27,46 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Fork",
|
||||
args: ["\n", "\n", false],
|
||||
args: ["\n", "\n", false]
|
||||
},
|
||||
{
|
||||
op: "Merge",
|
||||
args: [true],
|
||||
},
|
||||
],
|
||||
args: [true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fork, (expect) Error, Merge",
|
||||
input: "1,2,3,4\n\n3,4,5,6",
|
||||
expectedOutput: "Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?",
|
||||
expectedOutput:
|
||||
"Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Fork",
|
||||
args: ["\n\n", "\n\n", false],
|
||||
args: ["\n\n", "\n\n", false]
|
||||
},
|
||||
{
|
||||
op: "Set Union",
|
||||
args: ["\n\n", ","],
|
||||
args: ["\n\n", ","]
|
||||
},
|
||||
{
|
||||
op: "Merge",
|
||||
args: [true],
|
||||
},
|
||||
],
|
||||
args: [true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Fork, Conditional Jump, Encodings",
|
||||
input: "Some data with a 1 in it\nSome data with a 2 in it",
|
||||
expectedOutput: "U29tZSBkYXRhIHdpdGggYSAxIGluIGl0\n53 6f 6d 65 20 64 61 74 61 20 77 69 74 68 20 61 20 32 20 69 6e 20 69 74",
|
||||
expectedOutput:
|
||||
"U29tZSBkYXRhIHdpdGggYSAxIGluIGl0\n53 6f 6d 65 20 64 61 74 61 20 77 69 74 68 20 61 20 32 20 69 6e 20 69 74",
|
||||
recipeConfig: [
|
||||
{"op": "Fork", "args": ["\\n", "\\n", false]},
|
||||
{"op": "Conditional Jump", "args": ["1", false, "skipReturn", "10"]},
|
||||
{"op": "To Hex", "args": ["Space"]},
|
||||
{"op": "Return", "args": []},
|
||||
{"op": "Label", "args": ["skipReturn"]},
|
||||
{"op": "To Base64", "args": ["A-Za-z0-9+/="]}
|
||||
{ "op": "Fork", "args": ["\\n", "\\n", false] },
|
||||
{ "op": "Conditional Jump", "args": ["1", false, "skipReturn", "10"] },
|
||||
{ "op": "To Hex", "args": ["Space"] },
|
||||
{ "op": "Return", "args": [] },
|
||||
{ "op": "Label", "args": ["skipReturn"] },
|
||||
{ "op": "To Base64", "args": ["A-Za-z0-9+/="] }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -72,10 +74,10 @@ TestRegister.addTests([
|
|||
input: "Hello World",
|
||||
expectedOutput: "48656c6c6f 576f726c64",
|
||||
recipeConfig: [
|
||||
{ "op": "Fork", "args": [" ", " ", false] },
|
||||
{ "op": "Fork", "args": ["l", "l", false] },
|
||||
{ "op": "Merge", "args": [false] },
|
||||
{ "op": "To Hex", "args": ["None", 0] },
|
||||
{ "op": "Fork", "args": [" ", " ", false] },
|
||||
{ "op": "Fork", "args": ["l", "l", false] },
|
||||
{ "op": "Merge", "args": [false] },
|
||||
{ "op": "To Hex", "args": ["None", 0] }
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,8 +16,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "From Decimal",
|
||||
args: ["Space", false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Decimal with negatives",
|
||||
|
@ -27,7 +27,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "From Decimal",
|
||||
args: ["Comma", true]
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -33,7 +33,7 @@ TestRegister.addTests([
|
|||
"ZERO"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Encrypt: Kuznyechik",
|
||||
|
@ -55,7 +55,7 @@ TestRegister.addTests([
|
|||
"PKCS5"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Decrypt: Magma",
|
||||
|
@ -77,7 +77,7 @@ TestRegister.addTests([
|
|||
"ZERO"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Decrypt: Kuznyechik",
|
||||
|
@ -99,7 +99,7 @@ TestRegister.addTests([
|
|||
"PKCS5"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Sign",
|
||||
|
@ -119,7 +119,7 @@ TestRegister.addTests([
|
|||
48
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Verify",
|
||||
|
@ -138,7 +138,7 @@ TestRegister.addTests([
|
|||
"E-TEST"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Key Wrap",
|
||||
|
@ -158,7 +158,7 @@ TestRegister.addTests([
|
|||
"CP"
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "GOST Key Unwrap",
|
||||
|
@ -178,6 +178,6 @@ TestRegister.addTests([
|
|||
"CP"
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -22,7 +22,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Generate De Bruijn Sequence: Long Sequence",
|
||||
input: "",
|
||||
expectedOutput: "0000010000200003000110001200013000210002200023000310003200033001010010200103001110011200113001210012200123001310013200133002010020200203002110021200213002210022200223002310023200233003010030200303003110031200313003210032200323003310033200333010110101201013010210102201023010310103201033011020110301111011120111301121011220112301131011320113301202012030121101212012130122101222012230123101232012330130201303013110131201313013210132201323013310133201333020210202202023020310203202033021030211102112021130212102122021230213102132021330220302211022120221302221022220222302231022320223302303023110231202313023210232202323023310233202333030310303203033031110311203113031210312203123031310313203133032110321203213032210322203223032310323203233033110331203313033210332203323033310333203333111112111131112211123111321113311212112131122211223112321123311312113131132211323113321133312122121231213212133122131222212223122321223312313123221232312332123331313213133132221322313232132331332213323133321333322222322233223232233323233233333",
|
||||
expectedOutput:
|
||||
"0000010000200003000110001200013000210002200023000310003200033001010010200103001110011200113001210012200123001310013200133002010020200203002110021200213002210022200223002310023200233003010030200303003110031200313003210032200323003310033200333010110101201013010210102201023010310103201033011020110301111011120111301121011220112301131011320113301202012030121101212012130122101222012230123101232012330130201303013110131201313013210132201323013310133201333020210202202023020310203202033021030211102112021130212102122021230213102132021330220302211022120221302221022220222302231022320223302303023110231202313023210232202323023310233202333030310303203033031110311203113031210312203123031310313203133032110321203213032210322203223032310323203233033110331203313033210332203323033310333203333111112111131112211123111321113311212112131122211223112321123311312113131132211323113321133312122121231213212133122131222212223122321223312313123221232312332123331313213133132221322313232132331332213323133321333322222322233223232233323233233333",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Generate De Bruijn Sequence",
|
||||
|
|
|
@ -11,7 +11,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "All casings of test",
|
||||
input: "test",
|
||||
expectedOutput: "test\nTest\ntEst\nTEst\nteSt\nTeSt\ntESt\nTESt\ntesT\nTesT\ntEsT\nTEsT\nteST\nTeST\ntEST\nTEST",
|
||||
expectedOutput:
|
||||
"test\nTest\ntEst\nTEst\nteSt\nTeSt\ntESt\nTESt\ntesT\nTesT\ntEsT\nTEsT\nteST\nTeST\ntEST\nTEST",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Get All Casings",
|
||||
|
|
|
@ -13,7 +13,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Gzip: No comment, no checksum and no filename",
|
||||
input: "The quick brown fox jumped over the slow dog",
|
||||
expectedOutput: "0dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
expectedOutput:
|
||||
"0dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Gzip",
|
||||
|
@ -32,7 +33,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Gzip: No comment, no checksum and has a filename",
|
||||
input: "The quick brown fox jumped over the slow dog",
|
||||
expectedOutput: "636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
expectedOutput:
|
||||
"636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Gzip",
|
||||
|
@ -51,7 +53,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Gzip: Has a comment, no checksum and no filename",
|
||||
input: "The quick brown fox jumped over the slow dog",
|
||||
expectedOutput: "636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
expectedOutput:
|
||||
"636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Gzip",
|
||||
|
@ -70,7 +73,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Gzip: Has a comment, no checksum and has a filename",
|
||||
input: "The quick brown fox jumped over the slow dog",
|
||||
expectedOutput: "66696c656e616d6500636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
expectedOutput:
|
||||
"66696c656e616d6500636f6d6d656e74000dc9dd0180200804e0556ea8262848fb3dc588c6a7e76faa8aeedb726036c68d951f76bf9a0af8aae1f97d9c0c084b02509cbf8c2c000000",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Gzip",
|
||||
|
@ -85,5 +89,5 @@ TestRegister.addTests([
|
|||
args: ["None"]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
"op": "HASSH Client Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HASSH Server Fingerprint",
|
||||
|
@ -28,6 +28,6 @@ TestRegister.addTests([
|
|||
"op": "HASSH Server Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -13,36 +13,50 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c"},
|
||||
{"option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9"},
|
||||
"SHA256", "with salt", 42,
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c" },
|
||||
{ "option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9" },
|
||||
"SHA256",
|
||||
"with salt",
|
||||
42
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 2",
|
||||
"input": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f",
|
||||
"expectedOutput": "b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87",
|
||||
"input":
|
||||
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f",
|
||||
"expectedOutput":
|
||||
"b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87",
|
||||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf"},
|
||||
{"option": "Hex", "string": "b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"},
|
||||
"SHA256", "with salt", 82,
|
||||
],
|
||||
},
|
||||
],
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf"
|
||||
},
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
|
||||
},
|
||||
"SHA256",
|
||||
"with salt",
|
||||
82
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 3",
|
||||
|
@ -51,17 +65,19 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": ""},
|
||||
{"option": "Hex", "string": ""},
|
||||
"SHA256", "with salt", 42,
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "" },
|
||||
{ "option": "Hex", "string": "" },
|
||||
"SHA256",
|
||||
"with salt",
|
||||
42
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 4",
|
||||
|
@ -70,36 +86,50 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c"},
|
||||
{"option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9"},
|
||||
"SHA1", "with salt", 42,
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c" },
|
||||
{ "option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9" },
|
||||
"SHA1",
|
||||
"with salt",
|
||||
42
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 5",
|
||||
"input": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f",
|
||||
"expectedOutput": "0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4",
|
||||
"input":
|
||||
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f",
|
||||
"expectedOutput":
|
||||
"0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4",
|
||||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf"},
|
||||
{"option": "Hex", "string": "b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"},
|
||||
"SHA1", "with salt", 82,
|
||||
],
|
||||
},
|
||||
],
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf"
|
||||
},
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"
|
||||
},
|
||||
"SHA1",
|
||||
"with salt",
|
||||
82
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 6",
|
||||
|
@ -108,17 +138,13 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": ""},
|
||||
{"option": "Hex", "string": ""},
|
||||
"SHA1", "with salt", 42,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": [{ "option": "Hex", "string": "" }, { "option": "Hex", "string": "" }, "SHA1", "with salt", 42]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 7",
|
||||
|
@ -127,17 +153,13 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": ""},
|
||||
{"option": "Hex", "string": ""},
|
||||
"SHA1", "no salt", 42,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": [{ "option": "Hex", "string": "" }, { "option": "Hex", "string": "" }, "SHA1", "no salt", 42]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: RFC5869 Test Case 1 with skip extract",
|
||||
|
@ -146,17 +168,19 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": ""},
|
||||
{"option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9"},
|
||||
"SHA256", "skip", 42,
|
||||
],
|
||||
},
|
||||
],
|
||||
{ "option": "Hex", "string": "" },
|
||||
{ "option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9" },
|
||||
"SHA256",
|
||||
"skip",
|
||||
42
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HKDF: too large L",
|
||||
|
@ -165,16 +189,18 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": ["None"],
|
||||
"args": ["None"]
|
||||
},
|
||||
{
|
||||
"op": "Derive HKDF key",
|
||||
"args": [
|
||||
{"option": "Hex", "string": "000102030405060708090a0b0c"},
|
||||
{"option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9"},
|
||||
"SHA256", "with salt", 8161,
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{ "option": "Hex", "string": "000102030405060708090a0b0c" },
|
||||
{ "option": "Hex", "string": "f0f1f2f3f4f5f6f7f8f9" },
|
||||
"SHA256",
|
||||
"with salt",
|
||||
8161
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -88,7 +88,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA2 384",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "5485cc9b3365b4305dfb4e8337e0a598a574f8242bf17289e0dd6c20a3cd44a089de16ab4ab308f63e44b1170eb5f515",
|
||||
expectedOutput:
|
||||
"5485cc9b3365b4305dfb4e8337e0a598a574f8242bf17289e0dd6c20a3cd44a089de16ab4ab308f63e44b1170eb5f515",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA2",
|
||||
|
@ -110,7 +111,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA2 512",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "374d794a95cdcfd8b35993185fef9ba368f160d8daf432d08ba9f1ed1e5abe6cc69291e0fa2fe0006a52570ef18c19def4e617c33ce52ef0a6e5fbe318cb0387",
|
||||
expectedOutput:
|
||||
"374d794a95cdcfd8b35993185fef9ba368f160d8daf432d08ba9f1ed1e5abe6cc69291e0fa2fe0006a52570ef18c19def4e617c33ce52ef0a6e5fbe318cb0387",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA2",
|
||||
|
@ -154,7 +156,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA3 384",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "aa9ad8a49f31d2ddcabbb7010a1566417cff803fef50eba239558826f872e468c5743e7f026b0a8e5b2d7a1cc465cdbe",
|
||||
expectedOutput:
|
||||
"aa9ad8a49f31d2ddcabbb7010a1566417cff803fef50eba239558826f872e468c5743e7f026b0a8e5b2d7a1cc465cdbe",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA3",
|
||||
|
@ -176,7 +179,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA3 512",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "38e05c33d7b067127f217d8c856e554fcff09c9320b8a5979ce2ff5d95dd27ba35d1fba50c562dfd1d6cc48bc9c5baa4390894418cc942d968f97bcb659419ed",
|
||||
expectedOutput:
|
||||
"38e05c33d7b067127f217d8c856e554fcff09c9320b8a5979ce2ff5d95dd27ba35d1fba50c562dfd1d6cc48bc9c5baa4390894418cc942d968f97bcb659419ed",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA3",
|
||||
|
@ -198,7 +202,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Keccak 384",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "4d60892fde7f967bcabdc47c73122ae6311fa1f9be90d721da32030f7467a2e3db3f9ccb3c746483f9d2b876e39def17",
|
||||
expectedOutput:
|
||||
"4d60892fde7f967bcabdc47c73122ae6311fa1f9be90d721da32030f7467a2e3db3f9ccb3c746483f9d2b876e39def17",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Keccak",
|
||||
|
@ -220,7 +225,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Keccak 512",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "eda765576c84c600ed7f5d97510e92703b61f5215def2a161037fd9dd1f5b6ed4f86ce46073c0e3f34b52de0289e9c618798fff9dd4b1bfe035bdb8645fc6e37",
|
||||
expectedOutput:
|
||||
"eda765576c84c600ed7f5d97510e92703b61f5215def2a161037fd9dd1f5b6ed4f86ce46073c0e3f34b52de0289e9c618798fff9dd4b1bfe035bdb8645fc6e37",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Keccak",
|
||||
|
@ -242,7 +248,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Shake 256",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "b3be97bfd978833a65588ceae8a34cf59e95585af62063e6b89d0789f372424e8b0d1be4f21b40ce5a83a438473271e0661854f02d431db74e6904d6c347d757",
|
||||
expectedOutput:
|
||||
"b3be97bfd978833a65588ceae8a34cf59e95585af62063e6b89d0789f372424e8b0d1be4f21b40ce5a83a438473271e0661854f02d431db74e6904d6c347d757",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Shake",
|
||||
|
@ -308,7 +315,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Whirlpool-0",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "1c327026f565a0105a827efbfb3d3635cdb042c0aabb8416e96deb128e6c5c8684b13541cf31c26c1488949df050311c6999a12eb0e7002ad716350f5c7700ca",
|
||||
expectedOutput:
|
||||
"1c327026f565a0105a827efbfb3d3635cdb042c0aabb8416e96deb128e6c5c8684b13541cf31c26c1488949df050311c6999a12eb0e7002ad716350f5c7700ca",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Whirlpool",
|
||||
|
@ -319,7 +327,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Whirlpool-T",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "16c581089b6a6f356ae56e16a63a4c613eecd82a2a894b293f5ee45c37a31d09d7a8b60bfa7e414bd4a7166662cea882b5cf8c96b7d583fc610ad202591bcdb1",
|
||||
expectedOutput:
|
||||
"16c581089b6a6f356ae56e16a63a4c613eecd82a2a894b293f5ee45c37a31d09d7a8b60bfa7e414bd4a7166662cea882b5cf8c96b7d583fc610ad202591bcdb1",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Whirlpool",
|
||||
|
@ -330,7 +339,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Whirlpool",
|
||||
input: "Hello, World!",
|
||||
expectedOutput: "3d837c9ef7bb291bd1dcfc05d3004af2eeb8c631dd6a6c4ba35159b8889de4b1ec44076ce7a8f7bfa497e4d9dcb7c29337173f78d06791f3c3d9e00cc6017f0b",
|
||||
expectedOutput:
|
||||
"3d837c9ef7bb291bd1dcfc05d3004af2eeb8c631dd6a6c4ba35159b8889de4b1ec44076ce7a8f7bfa497e4d9dcb7c29337173f78d06791f3c3d9e00cc6017f0b",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Whirlpool",
|
||||
|
@ -422,7 +432,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Latin1", "string": "test"}, "SHA256"]
|
||||
"args": [{ "option": "Latin1", "string": "test" }, "SHA256"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -433,7 +443,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"}, "SHA224"]
|
||||
"args": [{ "option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b" }, "SHA224"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -444,29 +454,31 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"}, "SHA256"]
|
||||
"args": [{ "option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b" }, "SHA256"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 1 SHA-384",
|
||||
input: "Hi There",
|
||||
expectedOutput: "afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6",
|
||||
expectedOutput:
|
||||
"afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"}, "SHA384"]
|
||||
"args": [{ "option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b" }, "SHA384"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 1 SHA-512",
|
||||
input: "Hi There",
|
||||
expectedOutput: "87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854",
|
||||
expectedOutput:
|
||||
"87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"}, "SHA512"]
|
||||
"args": [{ "option": "Hex", "string": "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b" }, "SHA512"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -477,7 +489,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "4a656665"}, "SHA224"]
|
||||
"args": [{ "option": "Hex", "string": "4a656665" }, "SHA224"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -488,29 +500,31 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "4a656665"}, "SHA256"]
|
||||
"args": [{ "option": "Hex", "string": "4a656665" }, "SHA256"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 2 SHA-384",
|
||||
input: "what do ya want for nothing?",
|
||||
expectedOutput: "af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649",
|
||||
expectedOutput:
|
||||
"af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "4a656665"}, "SHA384"]
|
||||
"args": [{ "option": "Hex", "string": "4a656665" }, "SHA384"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 2 SHA-512",
|
||||
input: "what do ya want for nothing?",
|
||||
expectedOutput: "164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737",
|
||||
expectedOutput:
|
||||
"164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "4a656665"}, "SHA512"]
|
||||
"args": [{ "option": "Hex", "string": "4a656665" }, "SHA512"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -525,7 +539,7 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA224"]
|
||||
"args": [{ "option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "SHA224"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -540,14 +554,15 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA256"]
|
||||
"args": [{ "option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "SHA256"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 3 SHA-384",
|
||||
input: "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
|
||||
expectedOutput: "88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27",
|
||||
expectedOutput:
|
||||
"88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -555,14 +570,15 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA384"]
|
||||
"args": [{ "option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "SHA384"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 3 SHA-512",
|
||||
input: "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd",
|
||||
expectedOutput: "fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb",
|
||||
expectedOutput:
|
||||
"fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -570,7 +586,7 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA512"]
|
||||
"args": [{ "option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "SHA512"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -585,7 +601,7 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819"}, "SHA224"]
|
||||
"args": [{ "option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819" }, "SHA224"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -600,14 +616,15 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819"}, "SHA256"]
|
||||
"args": [{ "option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819" }, "SHA256"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 4 SHA-384",
|
||||
input: "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
|
||||
expectedOutput: "3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffb",
|
||||
expectedOutput:
|
||||
"3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffb",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -615,14 +632,15 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819"}, "SHA384"]
|
||||
"args": [{ "option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819" }, "SHA384"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 4 SHA-512",
|
||||
input: "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
|
||||
expectedOutput: "b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd",
|
||||
expectedOutput:
|
||||
"b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -630,7 +648,7 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819"}, "SHA512"]
|
||||
"args": [{ "option": "Hex", "string": "0102030405060708090a0b0c0d0e0f10111213141516171819" }, "SHA512"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -641,7 +659,14 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA224"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA224"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -652,29 +677,52 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA256"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA256"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 6 SHA-384",
|
||||
input: "Test Using Larger Than Block-Size Key - Hash Key First",
|
||||
expectedOutput: "4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952",
|
||||
expectedOutput:
|
||||
"4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA384"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA384"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 6 SHA-512",
|
||||
input: "Test Using Larger Than Block-Size Key - Hash Key First",
|
||||
expectedOutput: "80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598",
|
||||
expectedOutput:
|
||||
"80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA512"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA512"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -685,7 +733,14 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA224"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA224"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -696,29 +751,52 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA256"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA256"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 7 SHA-384",
|
||||
input: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.",
|
||||
expectedOutput: "6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e",
|
||||
expectedOutput:
|
||||
"6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523e",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA384"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA384"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "HMAC: RFC4231 Test Case 7 SHA-512",
|
||||
input: "This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.",
|
||||
expectedOutput: "e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58",
|
||||
expectedOutput:
|
||||
"e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "HMAC",
|
||||
"args": [{"option": "Hex", "string": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}, "SHA512"]
|
||||
"args": [
|
||||
{
|
||||
"option": "Hex",
|
||||
"string":
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
},
|
||||
"SHA512"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -785,7 +863,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA2 384: Complex bytes",
|
||||
input: "10dc10e32010de10d010dc10d810d910d010e12e",
|
||||
expectedOutput: "2a6369ffec550ea0bfb810b3b8246b7d6b7f060edfae88441f0f242b98b91549aa4ff407de38c6d03b5f377434ad2f36",
|
||||
expectedOutput:
|
||||
"2a6369ffec550ea0bfb810b3b8246b7d6b7f060edfae88441f0f242b98b91549aa4ff407de38c6d03b5f377434ad2f36",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -800,7 +879,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA2 512: Complex bytes",
|
||||
input: "10dc10e32010de10d010dc10d810d910d010e12e",
|
||||
expectedOutput: "544ae686522c05b70d12b460b5b39ea0a758eb4027333edbded7e2b3f467aa605804f71f54db61a7bbe50e6e7898510635efd6721fd418a9ea4d05b286d12806",
|
||||
expectedOutput:
|
||||
"544ae686522c05b70d12b460b5b39ea0a758eb4027333edbded7e2b3f467aa605804f71f54db61a7bbe50e6e7898510635efd6721fd418a9ea4d05b286d12806",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -845,7 +925,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA3 384: Complex bytes",
|
||||
input: "10dc10e32010de10d010dc10d810d910d010e12e",
|
||||
expectedOutput: "39f8796dd697dc39e5a943817833793f2c29dc0d1adc7037854c0fb51e135c6bd26b113240c4fb1e3fcc16ff8690c91a",
|
||||
expectedOutput:
|
||||
"39f8796dd697dc39e5a943817833793f2c29dc0d1adc7037854c0fb51e135c6bd26b113240c4fb1e3fcc16ff8690c91a",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -860,7 +941,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA3 512: Complex bytes",
|
||||
input: "10dc10e32010de10d010dc10d810d910d010e12e",
|
||||
expectedOutput: "ee9061bed83b1ad1e2fc4a4bac72a5a65a23a0fa55193b808af0a3e2013b718a5a3e40474765b4f93d1b2747401058a5b58099cc890a159db92b2ea816287add",
|
||||
expectedOutput:
|
||||
"ee9061bed83b1ad1e2fc4a4bac72a5a65a23a0fa55193b808af0a3e2013b718a5a3e40474765b4f93d1b2747401058a5b58099cc890a159db92b2ea816287add",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -919,7 +1001,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA2 384: UTF-8",
|
||||
input: "ნუ პანიკას",
|
||||
expectedOutput: "140b929391a66c9a943bcd60e6964f0d19526d3bc9ba020fbb29aae51cddb8e63a78784d8770f1d36335bf4efff8c131",
|
||||
expectedOutput:
|
||||
"140b929391a66c9a943bcd60e6964f0d19526d3bc9ba020fbb29aae51cddb8e63a78784d8770f1d36335bf4efff8c131",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA2",
|
||||
|
@ -930,7 +1013,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA2 512: UTF-8",
|
||||
input: "ნუ პანიკას",
|
||||
expectedOutput: "04a7887c400bf647b7c67b9a0f1ada70d176348b5afdfebea184f7e62748849828669c7b5160be99455fdbf625589bd1689c003bc06ef60c39607d825a2f8838",
|
||||
expectedOutput:
|
||||
"04a7887c400bf647b7c67b9a0f1ada70d176348b5afdfebea184f7e62748849828669c7b5160be99455fdbf625589bd1689c003bc06ef60c39607d825a2f8838",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA2",
|
||||
|
@ -963,7 +1047,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA3 384: UTF-8",
|
||||
input: "ნუ პანიკას",
|
||||
expectedOutput: "93e87b9aa8c9c47eba146adac357c525b418b71677f6db01d1c760d87b058682e639c8d43a8bfe91529cecd9800700e3",
|
||||
expectedOutput:
|
||||
"93e87b9aa8c9c47eba146adac357c525b418b71677f6db01d1c760d87b058682e639c8d43a8bfe91529cecd9800700e3",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA3",
|
||||
|
@ -974,7 +1059,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "SHA3 512: UTF-8",
|
||||
input: "ნუ პანიკას",
|
||||
expectedOutput: "1fbc484b5184982561795162757717474eebc846ca9f10029a75a54cdd897a7b48d1db42f2478fa1d5d213a0dd7de71c809cb19c60581ba57e7289d29408fb36",
|
||||
expectedOutput:
|
||||
"1fbc484b5184982561795162757717474eebc846ca9f10029a75a54cdd897a7b48d1db42f2478fa1d5d213a0dd7de71c809cb19c60581ba57e7289d29408fb36",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "SHA3",
|
||||
|
@ -996,7 +1082,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Scrypt: RFC test vector 1",
|
||||
input: "",
|
||||
expectedOutput: "77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906",
|
||||
expectedOutput:
|
||||
"77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Scrypt",
|
||||
|
@ -1005,7 +1092,10 @@ TestRegister.addTests([
|
|||
"option": "Latin1",
|
||||
"string": ""
|
||||
},
|
||||
16, 1, 1, 64
|
||||
16,
|
||||
1,
|
||||
1,
|
||||
64
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -1013,7 +1103,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Scrypt: RFC test vector 2",
|
||||
input: "password",
|
||||
expectedOutput: "fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640",
|
||||
expectedOutput:
|
||||
"fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Scrypt",
|
||||
|
@ -1022,7 +1113,10 @@ TestRegister.addTests([
|
|||
"option": "Latin1",
|
||||
"string": "NaCl"
|
||||
},
|
||||
1024, 8, 16, 64
|
||||
1024,
|
||||
8,
|
||||
16,
|
||||
64
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -1030,7 +1124,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Scrypt: RFC test vector 3",
|
||||
input: "pleaseletmein",
|
||||
expectedOutput: "7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887",
|
||||
expectedOutput:
|
||||
"7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Scrypt",
|
||||
|
@ -1039,7 +1134,10 @@ TestRegister.addTests([
|
|||
"option": "Latin1",
|
||||
"string": "SodiumChloride"
|
||||
},
|
||||
16384, 8, 1, 64
|
||||
16384,
|
||||
8,
|
||||
1,
|
||||
64
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -1069,7 +1167,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Streebog-512: Test Case 1",
|
||||
input: "",
|
||||
expectedOutput: "8e945da209aa869f0455928529bcae4679e9873ab707b55315f56ceb98bef0a7362f715528356ee83cda5f2aac4c6ad2ba3a715c1bcd81cb8e9f90bf4c1c1a8a",
|
||||
expectedOutput:
|
||||
"8e945da209aa869f0455928529bcae4679e9873ab707b55315f56ceb98bef0a7362f715528356ee83cda5f2aac4c6ad2ba3a715c1bcd81cb8e9f90bf4c1c1a8a",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Streebog",
|
||||
|
@ -1080,7 +1179,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Streebog-512: Test Case 2",
|
||||
input: "The quick brown fox jumps over the lazy dog",
|
||||
expectedOutput: "d2b793a0bb6cb5904828b5b6dcfb443bb8f33efc06ad09368878ae4cdc8245b97e60802469bed1e7c21a64ff0b179a6a1e0bb74d92965450a0adab69162c00fe",
|
||||
expectedOutput:
|
||||
"d2b793a0bb6cb5904828b5b6dcfb443bb8f33efc06ad09368878ae4cdc8245b97e60802469bed1e7c21a64ff0b179a6a1e0bb74d92965450a0adab69162c00fe",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Streebog",
|
||||
|
@ -1134,15 +1234,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Argon2",
|
||||
args: [
|
||||
{"option": "UTF8", "string": "somesalt"},
|
||||
3,
|
||||
4096,
|
||||
1,
|
||||
32,
|
||||
"Argon2i",
|
||||
"Encoded hash"
|
||||
]
|
||||
args: [{ "option": "UTF8", "string": "somesalt" }, 3, 4096, 1, 32, "Argon2i", "Encoded hash"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1153,9 +1245,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Argon2 compare",
|
||||
args: [
|
||||
"$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$s43my9eBljQADuF/LWCG8vGqwAJzOorKQ0Yog8jFvbw"
|
||||
]
|
||||
args: ["$argon2i$v=19$m=4096,t=3,p=1$c29tZXNhbHQ$s43my9eBljQADuF/LWCG8vGqwAJzOorKQ0Yog8jFvbw"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
"op": "Haversine distance",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Haversine distance, zero distance",
|
||||
|
@ -28,6 +28,6 @@ TestRegister.addTests([
|
|||
"op": "Haversine distance",
|
||||
"args": []
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -8,11 +8,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": [
|
||||
"None",
|
||||
0
|
||||
]
|
||||
},
|
||||
"args": ["None", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -22,10 +19,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": [
|
||||
"Colon",
|
||||
0
|
||||
]
|
||||
"args": ["Colon", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -36,10 +30,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": [
|
||||
"0x with comma",
|
||||
0
|
||||
]
|
||||
"args": ["0x with comma", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -50,10 +41,7 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": [
|
||||
"0x with comma",
|
||||
4
|
||||
]
|
||||
"args": ["0x with comma", 4]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -64,12 +52,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": [
|
||||
"Auto"
|
||||
]
|
||||
"args": ["Auto"]
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
name: "Multiline 0x hex to ASCII",
|
||||
|
@ -83,13 +68,12 @@ TestRegister.addTests([
|
|||
0x75,0x70,0x20,0x6d,0x79,0x20,0x6d,0x69,0x6e,0x64,0x20,0x77,0x68,0x69,0x63,\
|
||||
0x68,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x66,0x69,0x67,0x73,0x20,0x49,\
|
||||
0x20,0x77,0x6f,0x75,0x6c,0x64,0x20,0x63,0x68,0x6f,0x6f,0x73,0x65,0x2e",
|
||||
expectedOutput: "I saw myself sitting in the crotch of the this fig tree, starving to death, just because I couldn't make up my mind which of the figs I would choose.",
|
||||
expectedOutput:
|
||||
"I saw myself sitting in the crotch of the this fig tree, starving to death, just because I couldn't make up my mind which of the figs I would choose.",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": [
|
||||
"Auto"
|
||||
]
|
||||
"args": ["Auto"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -100,11 +84,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": [
|
||||
"0x with comma"
|
||||
]
|
||||
"args": ["0x with comma"]
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -24,7 +24,7 @@ const ALL_BYTES = [
|
|||
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf",
|
||||
"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf",
|
||||
"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
|
||||
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
|
||||
].join("");
|
||||
|
||||
TestRegister.addTests([
|
||||
|
@ -41,7 +41,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Hexdump: Hello, World!",
|
||||
|
@ -56,7 +56,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Hexdump: UTF-8",
|
||||
|
@ -71,7 +71,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Hexdump: All bytes",
|
||||
|
@ -86,7 +86,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Hexdump: UTF-8",
|
||||
|
@ -98,7 +98,7 @@ TestRegister.addTests([
|
|||
op: "To Hexdump",
|
||||
args: [16, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To Hexdump: All bytes",
|
||||
|
@ -124,7 +124,7 @@ TestRegister.addTests([
|
|||
op: "To Hexdump",
|
||||
args: [16, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Hexdump: xxd",
|
||||
|
@ -150,7 +150,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Hexdump: Wireshark",
|
||||
|
@ -177,7 +177,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Hexdump: Wireshark alt",
|
||||
|
@ -203,7 +203,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Hexdump: 010",
|
||||
|
@ -229,7 +229,7 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Hexdump: Linux hexdump",
|
||||
|
@ -256,6 +256,6 @@ TestRegister.addTests([
|
|||
op: "From Hexdump",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,14 +16,13 @@ TestRegister.addTests([
|
|||
name: "Render Image: nothing",
|
||||
input: "",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [
|
||||
{ op: "Render Image", args: ["Raw"] }
|
||||
]
|
||||
recipeConfig: [{ op: "Render Image", args: ["Raw"] }]
|
||||
},
|
||||
{
|
||||
name: "Render Image: raw gif",
|
||||
input: GIF_ANIMATED_HEX,
|
||||
expectedOutput: "<img src='data:image/gif;base64,R0lGODlhDwAPALMLAEJCQv/nAP/vAP/OAAAAAP+1AP+cAP//lP//EP//xv//7////wAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFMgALACwAAAAADwAPAAAEWnBJCWqdeFWVzhkXBnAIEgTCYAAT0J3oma7UERCEgOIp65o4GU9VOZgESFRyUCjGYjoUs3J86nRTwEBAkHkJRM22q+QOQJQzFxcMp8/wgrsFKNgLK1aGYtFPIgAh+QQFCgALACwDAAkACQABAAAEBTBIMWUEACH5BAUKAAsALAQACgAHAAEAAAQFMKw5QwQAIfkEBQoACwAsBAAEAAcAAQAABAVQBClDBAAh+QQFCgALACwDAAQACQACAAAECjAQIoKYV1xZSQQAIfkEBQoACwAsAwAEAAkAAgAABAkwCEkpIUFeEQEAIfkEBTIACwAsBAAEAAcAAQAABAWQkEVlBAAh+QQFGQALACwDAAQACAACAAAECZCssJYMUtQbAQAh+QQFGQALACwDAAQACQACAAAECTAIQmSgEotJIgAh+QQFCgALACwEAAQACAACAAAECXAFseoksmIRAQAh+QQFCgALACwDAAQACQACAAAECjAQIoKYV1xZSQQAIfkEBQoACwAsAwAEAAkAAgAABAkwCEkpIUFeEQEAIfkEBTIACwAsBAAEAAcAAQAABAWQkEVlBAAh+QQFGQALACwEAAMABwADAAAECpCQRSW9VIgrQgQAIfkEBRkACwAsAwADAAgAAgAABAmQrLCWFJLaGQEAIfkEBRkACwAsAwADAAkAAgAABArwBEJEmCQIqnEEACH5BAUZAAsALAUAAwAHAAMAAAQKMIRFxaCYEoJ3BAAh+QQFHgALACwEAAQACAACAAAECZAssZYUMtQbAQAh+QQFCgALACwEAAoABwABAAAEBZCsOUkEACH5BAUKAAsALAMACQAJAAEAAAQFkKxJF4kAOw=='>",
|
||||
expectedOutput:
|
||||
"<img src='data:image/gif;base64,R0lGODlhDwAPALMLAEJCQv/nAP/vAP/OAAAAAP+1AP+cAP//lP//EP//xv//7////wAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFMgALACwAAAAADwAPAAAEWnBJCWqdeFWVzhkXBnAIEgTCYAAT0J3oma7UERCEgOIp65o4GU9VOZgESFRyUCjGYjoUs3J86nRTwEBAkHkJRM22q+QOQJQzFxcMp8/wgrsFKNgLK1aGYtFPIgAh+QQFCgALACwDAAkACQABAAAEBTBIMWUEACH5BAUKAAsALAQACgAHAAEAAAQFMKw5QwQAIfkEBQoACwAsBAAEAAcAAQAABAVQBClDBAAh+QQFCgALACwDAAQACQACAAAECjAQIoKYV1xZSQQAIfkEBQoACwAsAwAEAAkAAgAABAkwCEkpIUFeEQEAIfkEBTIACwAsBAAEAAcAAQAABAWQkEVlBAAh+QQFGQALACwDAAQACAACAAAECZCssJYMUtQbAQAh+QQFGQALACwDAAQACQACAAAECTAIQmSgEotJIgAh+QQFCgALACwEAAQACAACAAAECXAFseoksmIRAQAh+QQFCgALACwDAAQACQACAAAECjAQIoKYV1xZSQQAIfkEBQoACwAsAwAEAAkAAgAABAkwCEkpIUFeEQEAIfkEBTIACwAsBAAEAAcAAQAABAWQkEVlBAAh+QQFGQALACwEAAMABwADAAAECpCQRSW9VIgrQgQAIfkEBRkACwAsAwADAAgAAgAABAmQrLCWFJLaGQEAIfkEBRkACwAsAwADAAkAAgAABArwBEJEmCQIqnEEACH5BAUZAAsALAUAAwAHAAMAAAQKMIRFxaCYEoJ3BAAh+QQFHgALACwEAAQACAACAAAECZAssZYUMtQbAQAh+QQFCgALACwEAAoABwABAAAEBZCsOUkEACH5BAUKAAsALAMACQAJAAEAAAQFkKxJF4kAOw=='>",
|
||||
recipeConfig: [
|
||||
{ op: "From Hex", args: ["Space"] },
|
||||
{ op: "Render Image", args: ["Raw"] }
|
||||
|
@ -32,18 +31,16 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Render Image: hex png",
|
||||
input: PNG_HEX,
|
||||
expectedOutput: "<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAFGElEQVRYw8VXXWwUVRT+7szszKzb3bbglqXbzbbQbYDQYJBGbWlTRUq1KtCmVYmECsHQKjE8mJrwYoIPpmIQEw2aaLA2PDRhATVpCxiLcYPBP0RQbIEVulNatt3SYX9mf2auD7QVlt3uLq3xPE3mnnvPd8/5zs8luD9hOzs7l1sslvJQKMR6PJ4fWlpafgWgAWAA0MnvlELSNEimDt65c6dpx44dB3JychplWUYgEGAAUFmWvxofHz9nNpvrwuHw72vXrt0KQJ0tAOJ0Oh8pKSlpFQRhmaZpAQB6o9FYBgATExPaJAAAAKWUEkKIqqq3Kisr7R0dHY+Lojhvw4YNnyXzyEwAiMvlai0sLNxHCNElUogHcKcoijIoCIIVADwez9aNGzd+nkiPS2bd6XSustvtSY2nElEUbVOO0bTkdGCS3d7hcLQwDKPDLCUcDt/YvHnz0WTeTgaAEQRheUoCEZKSxIIgLDh+/PhvPT09exOBSBYCSilV5iqLRFG0q6r62OSF1XQ8oAUCgVNpnE3TDIMUCoV+TJQJyQCgu7v7w2g0OjSjdUppOhxYt27d8tra2l2JACcFsHv37uEzZ848qyhK/2xIKAhCXmdn5wvJ6gAz0+bGxsZf1qxZU6FpWjRTw6FQyE0pVSmlmqZpkUzTcFrcbreSbqynRFXVYFVV1cMDAwP1kiS9Ul9ffzCZLof/QDRNUyilyqZNm75MpcvgfxZmrlItrkCl3Y7TCUHI5XJ9YzQan4pfGBoawvDwcCICngIQnSsAuuLiYgfLsvcs8DyPnJycRBxYDIBNxwszAli2wCC+uHrJq+y1n4sIc3e09PMKaLbeSCVJopIk3bUWi8Uc1dXVT/b19XXPppYz7euXHHji0ZXbBV53z7ai6q24FuW1n/r7GafTCVVV46tkNBqNlvb29v51XyR8adVCq9nAvTxw+QpijDD9X1ZULFxVD8ODdgBAbm4uyp4uQzg3/O/AyLLgef57n8/nq6mpKWYTxS9VCErMhkoCcBOyjIKKLTDoBby+Zw+sS1dA9akoWxjGoNtNqMGA/cb9sDXYUMVVoXSkFIQQuFyucpPJdEKn05U2NDQ0d3V1fZG2B1oqbEXWbOGDaSWGhd5kRlnZavRf+ANF+fkIyTKCExPE7/djm20bBoODWCQsgtlshiiKvlgs5uZ5fgUhhHAcl5eRB5bmGXaxDJkf/397UxO2NzVB1TQEJtNvdHQU5cZylGeVA6HpBjTm9XrbrFbrsUAg8OmhQ4fez4QDjI4jK1O0WIjcbexjY2OJ0pDJyspaPQmmoqampigTAFTTMJKixSJyu+RRWZYRPxYoirLIZDK9AQAcxy21WCyvZRIC6vVHPn6A168nBAnZyzIMDGYzHKWlYCwWJBgNSSQSOSvL8ttGo/E5SZL2ZcSBt3ovn3jnGUdrXhb/LgDTHa6FJMsw6PVgOQ7nLl4kPX19NBaLwWAwqHV1dSzLsgQAotHot0eOHDkM4PD9VEL65tcDnzQ9ZDlWNF9fy/H6/QCyGYaBRa/HjUuXEBobgzoyQm02G83Pz4fNZmOnpmSe5wclSXpvrt6G5MLJk88XFxbu5XU6650Lf16/rl32epm4YWTo5s2brc3NzcfSeuWmo/RRR8d5TdMOLlm8+JbA84Ucy+YCwKjfT8eDQTJp2BMMBvedPn16S1tb29m0W3fGAwTD8N91dS2zFxSs+Nvny77i9fr9fv/59vb2s1evXo1ket4/oXgLrXNMZZcAAAAASUVORK5CYII='>",
|
||||
recipeConfig: [
|
||||
{ op: "Render Image", args: ["Hex"] }
|
||||
]
|
||||
expectedOutput:
|
||||
"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAFGElEQVRYw8VXXWwUVRT+7szszKzb3bbglqXbzbbQbYDQYJBGbWlTRUq1KtCmVYmECsHQKjE8mJrwYoIPpmIQEw2aaLA2PDRhATVpCxiLcYPBP0RQbIEVulNatt3SYX9mf2auD7QVlt3uLq3xPE3mnnvPd8/5zs8luD9hOzs7l1sslvJQKMR6PJ4fWlpafgWgAWAA0MnvlELSNEimDt65c6dpx44dB3JychplWUYgEGAAUFmWvxofHz9nNpvrwuHw72vXrt0KQJ0tAOJ0Oh8pKSlpFQRhmaZpAQB6o9FYBgATExPaJAAAAKWUEkKIqqq3Kisr7R0dHY+Lojhvw4YNnyXzyEwAiMvlai0sLNxHCNElUogHcKcoijIoCIIVADwez9aNGzd+nkiPS2bd6XSustvtSY2nElEUbVOO0bTkdGCS3d7hcLQwDKPDLCUcDt/YvHnz0WTeTgaAEQRheUoCEZKSxIIgLDh+/PhvPT09exOBSBYCSilV5iqLRFG0q6r62OSF1XQ8oAUCgVNpnE3TDIMUCoV+TJQJyQCgu7v7w2g0OjSjdUppOhxYt27d8tra2l2JACcFsHv37uEzZ848qyhK/2xIKAhCXmdn5wvJ6gAz0+bGxsZf1qxZU6FpWjRTw6FQyE0pVSmlmqZpkUzTcFrcbreSbqynRFXVYFVV1cMDAwP1kiS9Ul9ffzCZLof/QDRNUyilyqZNm75MpcvgfxZmrlItrkCl3Y7TCUHI5XJ9YzQan4pfGBoawvDwcCICngIQnSsAuuLiYgfLsvcs8DyPnJycRBxYDIBNxwszAli2wCC+uHrJq+y1n4sIc3e09PMKaLbeSCVJopIk3bUWi8Uc1dXVT/b19XXPppYz7euXHHji0ZXbBV53z7ai6q24FuW1n/r7GafTCVVV46tkNBqNlvb29v51XyR8adVCq9nAvTxw+QpijDD9X1ZULFxVD8ODdgBAbm4uyp4uQzg3/O/AyLLgef57n8/nq6mpKWYTxS9VCErMhkoCcBOyjIKKLTDoBby+Zw+sS1dA9akoWxjGoNtNqMGA/cb9sDXYUMVVoXSkFIQQuFyucpPJdEKn05U2NDQ0d3V1fZG2B1oqbEXWbOGDaSWGhd5kRlnZavRf+ANF+fkIyTKCExPE7/djm20bBoODWCQsgtlshiiKvlgs5uZ5fgUhhHAcl5eRB5bmGXaxDJkf/397UxO2NzVB1TQEJtNvdHQU5cZylGeVA6HpBjTm9XrbrFbrsUAg8OmhQ4fez4QDjI4jK1O0WIjcbexjY2OJ0pDJyspaPQmmoqampigTAFTTMJKixSJyu+RRWZYRPxYoirLIZDK9AQAcxy21WCyvZRIC6vVHPn6A168nBAnZyzIMDGYzHKWlYCwWJBgNSSQSOSvL8ttGo/E5SZL2ZcSBt3ovn3jnGUdrXhb/LgDTHa6FJMsw6PVgOQ7nLl4kPX19NBaLwWAwqHV1dSzLsgQAotHot0eOHDkM4PD9VEL65tcDnzQ9ZDlWNF9fy/H6/QCyGYaBRa/HjUuXEBobgzoyQm02G83Pz4fNZmOnpmSe5wclSXpvrt6G5MLJk88XFxbu5XU6650Lf16/rl32epm4YWTo5s2brc3NzcfSeuWmo/RRR8d5TdMOLlm8+JbA84Ucy+YCwKjfT8eDQTJp2BMMBvedPn16S1tb29m0W3fGAwTD8N91dS2zFxSs+Nvny77i9fr9fv/59vb2s1evXo1ket4/oXgLrXNMZZcAAAAASUVORK5CYII='>",
|
||||
recipeConfig: [{ op: "Render Image", args: ["Hex"] }]
|
||||
},
|
||||
{
|
||||
name: "Render Image: base64 jpg",
|
||||
input: JPG_B64,
|
||||
expectedOutput: "<img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRQBAwQEBQQFCQUFCRQNCw0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQVFBQUFBQUFP/AABEIACAAIAMBEQACEQEDEQH/xAAbAAACAQUAAAAAAAAAAAAAAAAGBwkAAQIDCP/EAC4QAAIBAwIFAQcFAQAAAAAAAAECAwQFEQYSAAcIITFxIjJBQlJhwQkUFSORE//EABwBAAEFAQEBAAAAAAAAAAAAAAYAAgQFBwgDAf/EADARAAECBAQEBAYDAQAAAAAAAAECEQMEBSEABhIxQVFhoRMicZEUMnKBwdEVUrFC/9oADAMBAAIRAxEAPwCTPU+qDZ3jo6REnuUy71WQ4SJPG98d8Z7ADuT6EgSrlc/jiJaWAVHUHAPypG2pTXZ7AC6i4BDEi3kZETAMWKWQOW5PIfk8PYYDqif9y264XKrrZD5AnaGMeiIQMeuT9+M0jTJjHVOzK4iuiihP2SggN9Wo8ycESEaA0CGlI9AT7qfsw6YqmnFMwe33GropB4BnaaM+qOSP8wfvw6BM+CrVJTC4avqUtP3SsqDemk8iMJadYaPDSoegB90sfd/TBjpjU5u7yUdWiQ3GJd5EZ9iVPG9M98Z7EHuCR5yCdJolc/kSZaZATHSHt8qhtqS92exBukkAkggkdnpES4EWEXQbX3B5H8Hj7jEX/Vf1Xc3eTHUPqakm1HHTaZuGysskcNrp3V6YFoiju6FiyMhBAb5g3beBxT02VpmY/iJxST4mtSVeYuyCUp9BpD8nKuL4kzMSZp5hwQfKACLc7nv2bA5yz/UZ1fe9W2qyXOwUurDcqlKSCOywtR1gduynEkjRP385MQUZJOBwPZgyZLS8pEnJeaMMIDnXdLDqkBQ6WUSbAYnSFYiLiphRIYU9rWPe3cYy5m/qPatseqbrZLVp2k0q9tqWpJ0vkbVlWXXs3sxSLHH38ENKGGCDgjhZfyZLx5WHOTE0YgWHGiyWO11Ak9bJI2wp+sRERFQocPS1r3PYt3OC3pD6sObHO/n3Z6c32kk0xakasu8clrjT+pmWJY43UBgzFye5IxGx77cG6q0tTsufDTUMHxPESlPm4KISt+mk++nESUiTFQ8SEW06STbiLjv2fD16oemzTvO6WosGpoqilnt9VJNb7nQsq1FOshDEKWBBVht3KQQdo8FQRhs1WqpkrME1Dl2YqJ0lylSVEqSeFwDuNi4uHwZiVlqvIwlxN2FxuCLH/MKrp46NNBcnNe19xpbpcNRaqtka7P5IIgpI5lYCWONQM7gJE3kkZWRRghuPLMmdatXpFEGIhMOCs/8ALnUUnYknhYt1BNmxHkaXLSMXxASVDnwxr6jOjHQnN3Xdtu1XdblpzUt4YwN/GxrKlX/yiLGSRCp27URUMmQuTGpyzLl2Wc7VWhyS5eGhMSDDv5nGnUWYF7uS+lifmOwOPk9S5aejeIVFKjy44anS50zac5HVEVj00tVV1Nyqopbhcq5w086xkkA7QFVVBfCgfMckk54fArdTztX5SFMABIUCEpcBKQQpR4lyE7k8hbEn4SWpEjFWjdtzxOw7nHXWt9DQ6qRJ4isNwhG1JG911+lvwfhk8bpnLJ0LM0IRYJCJhAYE7Ef1VxZ9jdr2L4B6XVFSBKFXQe3UYTuqeVUFynhe8Wab93TKyQV9M0kM8KtjcI6iIh1DbVyFYZ2jPgcczR6RXqEtUGLLrAO/l1oLbHZSD0e4fg+DFM3LzI1IWPdj+8W0vyop7dUyy2izVD1s6CKW4VcktRUSICSqvUTMzlQSSFLYGTgcKBSa9XFJgwZdZHDyaEDrslAPc9cJU1Ly3mWse7n94cWiNCxaWR6iVlmuEq7WdfdRfpX8n44HHS+TMmw8swjGjELmFhiRskf1TxZ9zZ7WDYD6pVVT5CE2QO55nH//2Q=='>",
|
||||
recipeConfig: [
|
||||
{ op: "Render Image", args: ["Base64"] }
|
||||
]
|
||||
expectedOutput:
|
||||
"<img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRQBAwQEBQQFCQUFCRQNCw0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQVFBQUFBQUFP/AABEIACAAIAMBEQACEQEDEQH/xAAbAAACAQUAAAAAAAAAAAAAAAAGBwkAAQIDCP/EAC4QAAIBAwIFAQcFAQAAAAAAAAECAwQFEQYSAAcIITFxIjJBQlJhwQkUFSORE//EABwBAAEFAQEBAAAAAAAAAAAAAAYAAgQFBwgDAf/EADARAAECBAQEBAYDAQAAAAAAAAECEQMEBSEABhIxQVFhoRMicZEUMnKBwdEVUrFC/9oADAMBAAIRAxEAPwCTPU+qDZ3jo6REnuUy71WQ4SJPG98d8Z7ADuT6EgSrlc/jiJaWAVHUHAPypG2pTXZ7AC6i4BDEi3kZETAMWKWQOW5PIfk8PYYDqif9y264XKrrZD5AnaGMeiIQMeuT9+M0jTJjHVOzK4iuiihP2SggN9Wo8ycESEaA0CGlI9AT7qfsw6YqmnFMwe33GropB4BnaaM+qOSP8wfvw6BM+CrVJTC4avqUtP3SsqDemk8iMJadYaPDSoegB90sfd/TBjpjU5u7yUdWiQ3GJd5EZ9iVPG9M98Z7EHuCR5yCdJolc/kSZaZATHSHt8qhtqS92exBukkAkggkdnpES4EWEXQbX3B5H8Hj7jEX/Vf1Xc3eTHUPqakm1HHTaZuGysskcNrp3V6YFoiju6FiyMhBAb5g3beBxT02VpmY/iJxST4mtSVeYuyCUp9BpD8nKuL4kzMSZp5hwQfKACLc7nv2bA5yz/UZ1fe9W2qyXOwUurDcqlKSCOywtR1gduynEkjRP385MQUZJOBwPZgyZLS8pEnJeaMMIDnXdLDqkBQ6WUSbAYnSFYiLiphRIYU9rWPe3cYy5m/qPatseqbrZLVp2k0q9tqWpJ0vkbVlWXXs3sxSLHH38ENKGGCDgjhZfyZLx5WHOTE0YgWHGiyWO11Ak9bJI2wp+sRERFQocPS1r3PYt3OC3pD6sObHO/n3Z6c32kk0xakasu8clrjT+pmWJY43UBgzFye5IxGx77cG6q0tTsufDTUMHxPESlPm4KISt+mk++nESUiTFQ8SEW06STbiLjv2fD16oemzTvO6WosGpoqilnt9VJNb7nQsq1FOshDEKWBBVht3KQQdo8FQRhs1WqpkrME1Dl2YqJ0lylSVEqSeFwDuNi4uHwZiVlqvIwlxN2FxuCLH/MKrp46NNBcnNe19xpbpcNRaqtka7P5IIgpI5lYCWONQM7gJE3kkZWRRghuPLMmdatXpFEGIhMOCs/8ALnUUnYknhYt1BNmxHkaXLSMXxASVDnwxr6jOjHQnN3Xdtu1XdblpzUt4YwN/GxrKlX/yiLGSRCp27URUMmQuTGpyzLl2Wc7VWhyS5eGhMSDDv5nGnUWYF7uS+lifmOwOPk9S5aejeIVFKjy44anS50zac5HVEVj00tVV1Nyqopbhcq5w086xkkA7QFVVBfCgfMckk54fArdTztX5SFMABIUCEpcBKQQpR4lyE7k8hbEn4SWpEjFWjdtzxOw7nHXWt9DQ6qRJ4isNwhG1JG911+lvwfhk8bpnLJ0LM0IRYJCJhAYE7Ef1VxZ9jdr2L4B6XVFSBKFXQe3UYTuqeVUFynhe8Wab93TKyQV9M0kM8KtjcI6iIh1DbVyFYZ2jPgcczR6RXqEtUGLLrAO/l1oLbHZSD0e4fg+DFM3LzI1IWPdj+8W0vyop7dUyy2izVD1s6CKW4VcktRUSICSqvUTMzlQSSFLYGTgcKBSa9XFJgwZdZHDyaEDrslAPc9cJU1Ly3mWse7n94cWiNCxaWR6iVlmuEq7WdfdRfpX8n44HHS+TMmw8swjGjELmFhiRskf1TxZ9zZ7WDYD6pVVT5CE2QO55nH//2Q=='>",
|
||||
recipeConfig: [{ op: "Render Image", args: ["Base64"] }]
|
||||
},
|
||||
{
|
||||
name: "Extract EXIF: nothing",
|
||||
|
@ -52,9 +49,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Extract EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract EXIF: hello world text (error)",
|
||||
|
@ -63,9 +60,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Extract EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract EXIF: meerkat jpeg",
|
||||
|
@ -100,7 +97,7 @@ TestRegister.addTests([
|
|||
"SceneCaptureType: 0",
|
||||
"Contrast: 0",
|
||||
"Saturation: 0",
|
||||
"Sharpness: 0",
|
||||
"Sharpness: 0"
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
|
@ -109,9 +106,9 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
op: "Extract EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract EXIF: avatar jpeg",
|
||||
|
@ -124,9 +121,9 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
op: "Extract EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Remove EXIF: hello world text (error)",
|
||||
|
@ -135,9 +132,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Remove EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Remove EXIF: meerkat jpeg (has EXIF)",
|
||||
|
@ -150,13 +147,13 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
op: "Remove EXIF",
|
||||
args: [],
|
||||
args: []
|
||||
},
|
||||
{
|
||||
op: "Extract EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract EXIF: avatar jpeg (has no EXIF)",
|
||||
|
@ -169,18 +166,19 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
op: "Remove EXIF",
|
||||
args: [],
|
||||
args: []
|
||||
},
|
||||
{
|
||||
op: "Extract EXIF",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extract RGBA",
|
||||
input: "424d460400000000000036040000280000000400000004000000010008000000000010000000120b0000120b0000000100000001000000c8000000cf000000d7000000df000000e7000000ef000000f7000000ff000083000000ac000000d5000000ff000000000083000000ac000000d5000000ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f070d05030b01090c040e060008020a",
|
||||
expectedOutput: "0 200 0 0 0 131 0 215 0 0 0 213 131 0 0 0 231 0 213 0 0 0 247 0 0 223 0 0 0 255 0 207 0 0 0 172 255 0 0 0 255 0 172 0 0 0 239 0",
|
||||
expectedOutput:
|
||||
"0 200 0 0 0 131 0 215 0 0 0 213 131 0 0 0 231 0 213 0 0 0 247 0 0 223 0 0 0 255 0 207 0 0 0 172 255 0 0 0 255 0 172 0 0 0 239 0",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
|
@ -195,7 +193,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Extract LSB",
|
||||
input: PNG_HEX,
|
||||
expectedOutput: "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000208000000000000000000008000000000000000000000000248000000200240000000208908000000200240000000200821000000200240000000061249000000240000000000209b69000001a49b00000000a204a1200001a49b00000009800414000001a49b0000000035db6c00000094924000000086dffc20000df6dec8000001e10014a0000df6dec800002564924b00000df6dec80000009a6db20000007edb4124804177fffba0002fffff69249044e0924bc4002fffff6924905fb2db6d04002fffff692490416d2490040001bfffcc92030dbffffdc00037fffffdb6d302c6db6d700037fffffdb6d327eb6db6148037fffffdb6d30db4000014800dffffeb6d9aefffffff640",
|
||||
expectedOutput:
|
||||
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000208000000000000000000008000000000000000000000000248000000200240000000208908000000200240000000200821000000200240000000061249000000240000000000209b69000001a49b00000000a204a1200001a49b00000009800414000001a49b0000000035db6c00000094924000000086dffc20000df6dec8000001e10014a0000df6dec800002564924b00000df6dec80000009a6db20000007edb4124804177fffba0002fffff69249044e0924bc4002fffff6924905fb2db6d04002fffff692490416d2490040001bfffcc92030dbffffdc00037fffffdb6d302c6db6d700037fffffdb6d327eb6db6148037fffffdb6d30db4000014800dffffeb6d9aefffffff640",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
|
@ -214,7 +213,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "View Bit Plane",
|
||||
input: PNG_HEX,
|
||||
expectedOutput: "89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000140494441547801c5c1416ea3400000c1ee11ffff726fe6808410186ce26c95fde0432a154f0cdea4b2aa505151519954ee1a5c50995454aea8ac54ae2c5ca8982a3ea132551c199c507942e58ec1898adf50f1cae084ca15952b2a152a47067f40a5e2c8e00f54a81c199ca8b85271a542a5e2c8e005159527542ace0c5ea8a8f844c54ae5ccc217555c197c41c55d83ff6cf0052a772ddca052b1a752b1a772d7c2432a4f2c3c50f1d4c20b2a1593ca918a4965afe2cac29b2a562a93ca56c55d0b2754b62a269555c554b15251a9b8637040e5884ac54a654ba5a2624be5cce040c5918a55c55ec5a4a232a9549c197c48655239523155bc3278a862af624be5ccc2072aaea854a8549c5978834a85ca5ec5918a57ec076f50a958a9546ca94c1557ec071754a68a2d958a270637544c2a2abf69e1a68a95ca54b152a978d73f2e08bd57b6f839a00000000049454e44ae426082",
|
||||
expectedOutput:
|
||||
"89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000140494441547801c5c1416ea3400000c1ee11ffff726fe6808410186ce26c95fde0432a154f0cdea4b2aa505151519954ee1a5c50995454aea8ac54ae2c5ca8982a3ea132551c199c507942e58ec1898adf50f1cae084ca15952b2a152a47067f40a5e2c8e00f54a81c199ca8b85271a542a5e2c8e005159527542ace0c5ea8a8f844c54ae5ccc217555c197c41c55d83ff6cf0052a772ddca052b1a752b1a772d7c2432a4f2c3c50f1d4c20b2a1593ca918a4965afe2cac29b2a562a93ca56c55d0b2754b62a269555c554b15251a9b8637040e5884ac54a654ba5a2624be5cce040c5918a55c55ec5a4a232a9549c197c48655239523155bc3278a862af624be5ccc2072aaea854a8549c5978834a85ca5ec5918a57ec076f50a958a9546ca94c1557ec071754a68a2d958a270637544c2a2abf69e1a68a95ca54b152a978d73f2e08bd57b6f839a00000000049454e44ae426082",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
|
@ -233,7 +233,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Randomize Colour Palette",
|
||||
"input": PNG_HEX,
|
||||
expectedOutput: "89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000004f3494441547801c5c10b50cf0700c0f16fbfff8f0ae5f157ed9f1e446358ab28b3913f29b3f89f65deab9859c624cafbf557b6eb3662799c8a285c541479ed3c125d2d2cba52e45d4da8bc66b99d1ebbff6ddd75ddeff7efef75fb7c8c5cb5b10dbc869ccbd1ac4f0c67dfc55cba1f9ec32dd303bc0e854aadd1f20ace5f29e1c9346b4c3982aada03b3285b540f4b099f664ca5720321a34c582466b2f38f3e1842a1526bb4e811efe64a56403a465dc270a998cb517b47e62f7842870b6aaabc5b519627a253784e606a8e25470fbbe358a0c2fd692f9c9668b8bda084e77d5f2247448f790f42a9b9da915d415a6020508a3e49e207e8ec7961cb9594545657e5e26e0fdaf9df5014998a141119f16eae24b4db84f7d775bc8e3e3e9e24f12fabaccf282210292232ce6a5e12dab58e37656be7cf8893916498d72345404681d7365ae217b18b969495261019998f8569145204e47c3e99b7a58f8f278fa76e478a808c522f23de165b3b7f3aee9c8e14011956e9b6841c29419f5d8bfd6889ad9d3fc1c9c654be08428a808cfc9a0c02e7d711973a823751569ac0c79dd72347408fb9ee3d102f4c616d9c82579596dd8df1b5c58caf2d26625d2fe488b420b16c129e3d7825534ccbb01a3881f0803354adba49c5853ce488bc037ba66b48c93586e20298885e02ff338177c0a1ed600c256200973699b0f130cd9dafcd20c87a3bcd9d29d90b1462081103c4d444d1bee2139aab9b7c87ec50479adbd47f13a0c610227a94af8a6565ce118ce72dc1618d3b4ded6f678465840dd905bd519f3e455305e67eb4f1db8ed94fdeb444448f0dbb94740bcec029db9fa636fc99cbf176a708b9e44198af3573469b323cb992469694b031bd133b2a955cb2a8461f0119a3b6f810fcac81619ea1c42cbf43a3711393d8727b1ee37ad6a263b1388cc8a872264cc8a7d1c97116d407ede1ab9c44ac3de610e5f32372142ab5468b84d091d984d79a90147e8dfb8322e8bcf71cdf370ce07ae6158606ee479c164c8794ddf88f76664c5d3d96579ee171db85d9917524b996102e2e65d882753c4c28e690714f9e3ffa1b2902122a0e6571a3c8864657b304ee2e4d6579e1038e0879cc0c716765c67ec2ee1d63cbaa9154db0760ffcc8e0fd7f643d3ba9c31ce69fc3c68124507bae060eb8379dc45e4884850aa4730ca2e97e68a572ca178055c7ff411cb56c4002bf86ef6717c53f94f3c3a4ff72590d6fa09ef134ae0a983ec1efc2b720424fc55b8107dbea8fe81134ecee8687c4d68ae62de45bc636ad099782b126b8f39c81190b0f292127d5295cb98f2b415aa2a055dcb2fb035b081a686f48ee5f4d37ee80c9d91498855007204240cc9ea89efeabec871ec5443c381b1980c9a4f456d1233a38d68ce667c2ee7c2927019e1ce8bb84ce48848f832d10bb1f50dd6540d03d268d4677d39ed1d52514407d3b6d8830327dc49b0984574507b3a3b0573fb5806f762afa37379790e7783ab0849ee0f66fd91a350a9355a24d4bb754239ca02df597598d52dc5c2bb339503cde95213cff3a089240d7f48fd522f9c943eec1db088e53b0412631ea193dec188e4b3a7d9d6eb535a62e4aa8d6da005bfe4d9125de082dbcd6f69ca6ecc66c2166ca329eb198ee4bf5780a5ba3b861030c05cd732eea4acc3c42106671f0d52ac6738727064325b8ff5c752dd1d4329546a8d1603bc2c51f2bbf3356eae2c64b379374c964561b5f53c36d65e14fd3683c7f7179232d686bdf9777915ff00ec08ae8ecb66a3370000000049454e44ae426082",
|
||||
expectedOutput:
|
||||
"89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000004f3494441547801c5c10b50cf0700c0f16fbfff8f0ae5f157ed9f1e446358ab28b3913f29b3f89f65deab9859c624cafbf557b6eb3662799c8a285c541479ed3c125d2d2cba52e45d4da8bc66b99d1ebbff6ddd75ddeff7efef75fb7c8c5cb5b10dbc869ccbd1ac4f0c67dfc55cba1f9ec32dd303bc0e854aadd1f20ace5f29e1c9346b4c3982aada03b3285b540f4b099f664ca5720321a34c582466b2f38f3e1842a1526bb4e811efe64a56403a465dc270a998cb517b47e62f7842870b6aaabc5b519627a253784e606a8e25470fbbe358a0c2fd692f9c9668b8bda084e77d5f2247448f790f42a9b9da915d415a6020508a3e49e207e8ec7961cb9594545657e5e26e0fdaf9df5014998a141119f16eae24b4db84f7d775bc8e3e3e9e24f12fabaccf282210292232ce6a5e12dab58e37656be7cf8893916498d72345404681d7365ae217b18b969495261019998f8569145204e47c3e99b7a58f8f278fa76e478a808c522f23de165b3b7f3aee9c8e14011956e9b6841c29419f5d8bfd6889ad9d3fc1c9c654be08428a808cfc9a0c02e7d711973a823751569ac0c79dd72347408fb9ee3d102f4c616d9c82579596dd8df1b5c58caf2d26625d2fe488b420b16c129e3d7825534ccbb01a3881f0803354adba49c5853ce488bc037ba66b48c93586e20298885e02ff338177c0a1ed600c256200973699b0f130cd9dafcd20c87a3bcd9d29d90b1462081103c4d444d1bee2139aab9b7c87ec50479adbd47f13a0c610227a94af8a6565ce118ce72dc1618d3b4ded6f678465840dd905bd519f3e455305e67eb4f1db8ed94fdeb444448f0dbb94740bcec029db9fa636fc99cbf176a708b9e44198af3573469b323cb992469694b031bd133b2a955cb2a8461f0119a3b6f810fcac81619ea1c42cbf43a3711393d8727b1ee37ad6a263b1388cc8a872264cc8a7d1c97116d407ede1ab9c44ac3de610e5f32372142ab5468b84d091d984d79a90147e8dfb8322e8bcf71cdf370ce07ae6158606ee479c164c8794ddf88f76664c5d3d96579ee171db85d9917524b996102e2e65d882753c4c28e690714f9e3ffa1b2902122a0e6571a3c8864657b304ee2e4d6579e1038e0879cc0c716765c67ec2ee1d63cbaa9154db0760ffcc8e0fd7f643d3ba9c31ce69fc3c68124507bae060eb8379dc45e4884850aa4730ca2e97e68a572ca178055c7ff411cb56c4002bf86ef6717c53f94f3c3a4ff72590d6fa09ef134ae0a983ec1efc2b720424fc55b8107dbea8fe81134ecee8687c4d68ae62de45bc636ad099782b126b8f39c81190b0f292127d5295cb98f2b415aa2a055dcb2fb035b081a686f48ee5f4d37ee80c9d91498855007204240cc9ea89efeabec871ec5443c381b1980c9a4f456d1233a38d68ce667c2ee7c2927019e1ce8bb84ce48848f832d10bb1f50dd6540d03d268d4677d39ed1d52514407d3b6d8830327dc49b0984574507b3a3b0573fb5806f762afa37379790e7783ab0849ee0f66fd91a350a9355a24d4bb754239ca02df597598d52dc5c2bb339503cde95213cff3a089240d7f48fd522f9c943eec1db088e53b0412631ea193dec188e4b3a7d9d6eb535a62e4aa8d6da005bfe4d9125de082dbcd6f69ca6ecc66c2166ca329eb198ee4bf5780a5ba3b861030c05cd732eea4acc3c42106671f0d52ac6738727064325b8ff5c752dd1d4329546a8d1603bc2c51f2bbf3356eae2c64b379374c964561b5f53c36d65e14fd3683c7f7179232d686bdf9777915ff00ec08ae8ecb66a3370000000049454e44ae426082",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
|
@ -248,7 +249,7 @@ TestRegister.addTests([
|
|||
args: ["None"]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
/* { This operation only works in a browser
|
||||
name: "Optical Character Recognition",
|
||||
input: "iVBORw0KGgoAAAANSUhEUgAAAUAAAAC0CAIAAABqhmJGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAASuSURBVHhe7dftVdswAIbRzsVAzMM0XabDUCOUxLYsWW4Jp+/pvf9w9GH76CHw4x2IJWAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAI9p8G/PbyY8rL2686g8t+vnqHTyfgIYfvz/26veTXn/UKX8+f0EU9bHrtu/6KfAN/AwEXAj7lFf2TBFw4nae8on+SgIvJ01n/KLzpDK+L3bT/Ap4O+HC+V12mTH+M3gzcLbIY/EO6HfxYp13k09nb6r3UqcdnjoCL3ll72J26h+35Oxy2XvZ0wOLaXq9v2+F1UC+7RZtMZ/DnfX1lwDOPzwUCLo7O2trtDK8H3M/iqoc6bj1subT68XTA/F7bGJooyzKbhTvLPHY8eJLHlbNX1DqYUVfdXbqwJjsCLsans37aNNJM6w68OR0wv9f9ymKw3k67yn2ZZpHlg3a3zis60s6oV+ZvlzMCLoanc3Dsdt9TdWT/lM8OmNjr5KY72jmzq1zfrbvXtVtmRMDF8HTWcgaaqIrD1U4G/MFewxrW262s5jS/Fzpmdts6mnHy+Fwl4GJ0OjsNrG1P/y7CNo3+gEt7jW56MVprNed7A/5w+n6YJ+BieDpnj/jO6pweTz0acGWvmZveL9XOmd3x6wKuTt8PEwRczLRw4eje1XX7c/cDruw1uuneOu2c4aOvzI57mJhRh1xZlQ0BF+Oz9vcF96fuB1zYa7R2b5mD6/XSwdfg8snj4q21+W/L02dfzIxhQMDFyTm6Hd7m+JYP7rPKT5sRuzhOBywm91rUkYc3fV9ltchtr8VmzuGOdfDB9N1tFYefNfdXLmyGjNZkhoCLUQufVqd/7z7rUcLW/XieDvg0s9difNOdRV5ePibt5vTuazusWbF9rs2E5v4mH58LBFyMW7g5OID7s9cMuTygmt9rcNPb5MrAz0lHc3Z9Ht7XZsxqxO36ZtLR/c0+PpMEzLOc/4LhrwmYZ6lfywJ+JgHzJPr9DgLmi23/zdXvcwmYL7YKWL1PJ2AIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmAIJmCI9f7+G6yFxVg/GyYwAAAAAElFTkSuQmCC",
|
||||
|
|
|
@ -16,7 +16,7 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Index of Coincidence",
|
||||
"args": []
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
"op": "JA3 Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JA3 Fingerprint: TLS 1.1",
|
||||
|
@ -28,7 +28,7 @@ TestRegister.addTests([
|
|||
"op": "JA3 Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JA3 Fingerprint: TLS 1.2",
|
||||
|
@ -39,7 +39,7 @@ TestRegister.addTests([
|
|||
"op": "JA3 Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JA3 Fingerprint: TLS 1.3",
|
||||
|
@ -50,6 +50,6 @@ TestRegister.addTests([
|
|||
"op": "JA3 Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
"op": "JA3S Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JA3S Fingerprint: TLS 1.1",
|
||||
|
@ -28,7 +28,7 @@ TestRegister.addTests([
|
|||
"op": "JA3S Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JA3S Fingerprint: TLS 1.2",
|
||||
|
@ -39,8 +39,8 @@ TestRegister.addTests([
|
|||
"op": "JA3S Fingerprint",
|
||||
"args": ["Hex", "Hash digest"]
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
// This Server Hello was based on draft 18 of the TLS1.3 spec which does not include a Session ID field, leading it to fail.
|
||||
// The published version of TLS1.3 does require a legacy Session ID field (even if it is empty).
|
||||
// {
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
},
|
||||
],
|
||||
args: [" ", false, false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: space, number",
|
||||
|
@ -27,24 +27,24 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
},
|
||||
],
|
||||
args: [" ", false, false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: space, string",
|
||||
input: "\"string\"",
|
||||
expectedOutput: "\"string\"",
|
||||
input: '"string"',
|
||||
expectedOutput: '"string"',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
args: [" ", false, false]
|
||||
},
|
||||
{
|
||||
op: "HTML To Text",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: space, boolean",
|
||||
|
@ -53,9 +53,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
},
|
||||
],
|
||||
args: [" ", false, false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: space, emptyList",
|
||||
|
@ -64,9 +64,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
},
|
||||
],
|
||||
args: [" ", false, false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: space, list",
|
||||
|
@ -75,9 +75,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
},
|
||||
],
|
||||
args: [" ", false, false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: tab, list",
|
||||
|
@ -86,53 +86,55 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: ["\t", false, false],
|
||||
},
|
||||
],
|
||||
args: ["\t", false, false]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: space, object",
|
||||
input: "{\"second\":2,\"first\":3}",
|
||||
expectedOutput: "{\n \"second\": 2,\n \"first\": 3\n}",
|
||||
input: '{"second":2,"first":3}',
|
||||
expectedOutput: '{\n "second": 2,\n "first": 3\n}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: [" ", false, false],
|
||||
args: [" ", false, false]
|
||||
},
|
||||
{
|
||||
op: "HTML To Text",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: tab, nested",
|
||||
input: "[2,{\"second\":2,\"first\":3,\"beginning\":{\"j\":\"3\",\"i\":[2,3,false]}},1,2,3]",
|
||||
expectedOutput: "[\n\t2,\n\t{\n\t\t\"second\": 2,\n\t\t\"first\": 3,\n\t\t\"beginning\": {\n\t\t\t\"j\": \"3\",\n\t\t\t\"i\": [\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\tfalse\n\t\t\t]\n\t\t}\n\t},\n\t1,\n\t2,\n\t3\n]",
|
||||
input: '[2,{"second":2,"first":3,"beginning":{"j":"3","i":[2,3,false]}},1,2,3]',
|
||||
expectedOutput:
|
||||
'[\n\t2,\n\t{\n\t\t"second": 2,\n\t\t"first": 3,\n\t\t"beginning": {\n\t\t\t"j": "3",\n\t\t\t"i": [\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\tfalse\n\t\t\t]\n\t\t}\n\t},\n\t1,\n\t2,\n\t3\n]',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: ["\t", false, false],
|
||||
args: ["\t", false, false]
|
||||
},
|
||||
{
|
||||
op: "HTML To Text",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Beautify: tab, nested, sorted",
|
||||
input: "[2,{\"second\":2,\"first\":3,\"beginning\":{\"j\":\"3\",\"i\":[2,3,false]}},1,2,3]",
|
||||
expectedOutput: "[\n\t2,\n\t{\n\t\t\"beginning\": {\n\t\t\t\"i\": [\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\tfalse\n\t\t\t],\n\t\t\t\"j\": \"3\"\n\t\t},\n\t\t\"first\": 3,\n\t\t\"second\": 2\n\t},\n\t1,\n\t2,\n\t3\n]",
|
||||
input: '[2,{"second":2,"first":3,"beginning":{"j":"3","i":[2,3,false]}},1,2,3]',
|
||||
expectedOutput:
|
||||
'[\n\t2,\n\t{\n\t\t"beginning": {\n\t\t\t"i": [\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\tfalse\n\t\t\t],\n\t\t\t"j": "3"\n\t\t},\n\t\t"first": 3,\n\t\t"second": 2\n\t},\n\t1,\n\t2,\n\t3\n]',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Beautify",
|
||||
args: ["\t", true, false],
|
||||
args: ["\t", true, false]
|
||||
},
|
||||
{
|
||||
op: "HTML To Text",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: number",
|
||||
|
@ -27,9 +27,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: number",
|
||||
|
@ -38,20 +38,20 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: string",
|
||||
input: "\"string\"",
|
||||
expectedOutput: "\"string\"",
|
||||
input: '"string"',
|
||||
expectedOutput: '"string"',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: boolean",
|
||||
|
@ -60,9 +60,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: emptyList",
|
||||
|
@ -71,9 +71,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: list",
|
||||
|
@ -82,30 +82,30 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: object",
|
||||
input: "{\n \"second\": 2,\n \"first\": 3\n}",
|
||||
expectedOutput: "{\"second\":2,\"first\":3}",
|
||||
input: '{\n "second": 2,\n "first": 3\n}',
|
||||
expectedOutput: '{"second":2,"first":3}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON Minify: tab, nested",
|
||||
input: "[\n\t2,\n\t{\n\t\t\"second\": 2,\n\t\t\"first\": 3,\n\t\t\"beginning\": {\n\t\t\t\"j\": \"3\",\n\t\t\t\"i\": [\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\tfalse\n\t\t\t]\n\t\t}\n\t},\n\t1,\n\t2,\n\t3\n]",
|
||||
expectedOutput: "[2,{\"second\":2,\"first\":3,\"beginning\":{\"j\":\"3\",\"i\":[2,3,false]}},1,2,3]",
|
||||
input: '[\n\t2,\n\t{\n\t\t"second": 2,\n\t\t"first": 3,\n\t\t"beginning": {\n\t\t\t"j": "3",\n\t\t\t"i": [\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\tfalse\n\t\t\t]\n\t\t}\n\t},\n\t1,\n\t2,\n\t3\n]',
|
||||
expectedOutput: '[2,{"second":2,"first":3,"beginning":{"j":"3","i":[2,3,false]}},1,2,3]',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -15,69 +15,72 @@ const EXPECTED_CSV_EMPTY = "\r\n\r\n";
|
|||
TestRegister.addTests([
|
||||
{
|
||||
name: "JSON to CSV: strings as values",
|
||||
input: JSON.stringify({a: "1", b: "2", c: "3"}),
|
||||
input: JSON.stringify({ a: "1", b: "2", c: "3" }),
|
||||
expectedOutput: EXPECTED_CSV_SINGLE,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: numbers as values",
|
||||
input: JSON.stringify({a: 1, b: 2, c: 3}),
|
||||
input: JSON.stringify({ a: 1, b: 2, c: 3 }),
|
||||
expectedOutput: EXPECTED_CSV_SINGLE,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: numbers and strings as values",
|
||||
input: JSON.stringify({a: 1, b: "2", c: 3}),
|
||||
input: JSON.stringify({ a: 1, b: "2", c: 3 }),
|
||||
expectedOutput: EXPECTED_CSV_SINGLE,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: boolean and null as values",
|
||||
input: JSON.stringify({a: false, b: null, c: 3}),
|
||||
input: JSON.stringify({ a: false, b: null, c: 3 }),
|
||||
expectedOutput: "a,b,c\r\nfalse,null,3\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: JSON as an array",
|
||||
input: JSON.stringify([{a: 1, b: "2", c: 3}]),
|
||||
input: JSON.stringify([{ a: 1, b: "2", c: 3 }]),
|
||||
expectedOutput: EXPECTED_CSV_SINGLE,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: multiple JSON values in an array",
|
||||
input: JSON.stringify([{a: 1, b: "2", c: 3}, {a: 1, b: "2", c: 3}]),
|
||||
input: JSON.stringify([
|
||||
{ a: 1, b: "2", c: 3 },
|
||||
{ a: 1, b: "2", c: 3 }
|
||||
]),
|
||||
expectedOutput: EXPECTED_CSV_MULTIPLE,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: empty JSON",
|
||||
|
@ -87,8 +90,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: empty JSON in array",
|
||||
|
@ -98,73 +101,73 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: nested JSON",
|
||||
input: JSON.stringify({a: 1, b: {c: 2, d: 3}}),
|
||||
input: JSON.stringify({ a: 1, b: { c: 2, d: 3 } }),
|
||||
expectedOutput: "a,b.c,b.d\r\n1,2,3\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: nested array",
|
||||
input: JSON.stringify({a: 1, b: [2, 3]}),
|
||||
input: JSON.stringify({ a: 1, b: [2, 3] }),
|
||||
expectedOutput: "a,b.0,b.1\r\n1,2,3\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: nested JSON, nested array",
|
||||
input: JSON.stringify({a: 1, b: {c: [2, 3], d: 4}}),
|
||||
input: JSON.stringify({ a: 1, b: { c: [2, 3], d: 4 } }),
|
||||
expectedOutput: "a,b.c.0,b.c.1,b.d\r\n1,2,3,4\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: nested array, nested JSON",
|
||||
input: JSON.stringify({a: 1, b: [{c: 3, d: 4}]}),
|
||||
input: JSON.stringify({ a: 1, b: [{ c: 3, d: 4 }] }),
|
||||
expectedOutput: "a,b.0.c,b.0.d\r\n1,3,4\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: nested array, nested array",
|
||||
input: JSON.stringify({a: 1, b: [[2, 3]]}),
|
||||
input: JSON.stringify({ a: 1, b: [[2, 3]] }),
|
||||
expectedOutput: "a,b.0.0,b.0.1\r\n1,2,3\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JSON to CSV: nested JSON, nested JSON",
|
||||
input: JSON.stringify({a: 1, b: { c: { d: 2, e: 3}}}),
|
||||
input: JSON.stringify({ a: 1, b: { c: { d: 2, e: 3 } } }),
|
||||
expectedOutput: "a,b.c.d,b.c.e\r\n1,2,3\r\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JSON to CSV",
|
||||
args: [",", "\\r\\n"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -8,11 +8,15 @@
|
|||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
const outputObject = JSON.stringify({
|
||||
String: "SomeString",
|
||||
Number: 42,
|
||||
iat: 1
|
||||
}, null, 4);
|
||||
const outputObject = JSON.stringify(
|
||||
{
|
||||
String: "SomeString",
|
||||
Number: 42,
|
||||
iat: 1
|
||||
},
|
||||
null,
|
||||
4
|
||||
);
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
|
@ -22,9 +26,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: [],
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Decode: RS",
|
||||
|
@ -33,9 +37,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: [],
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Decode: ES",
|
||||
|
@ -44,8 +48,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: [],
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -8,11 +8,15 @@
|
|||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
const inputObject = JSON.stringify({
|
||||
String: "SomeString",
|
||||
Number: 42,
|
||||
iat: 1
|
||||
}, null, 4);
|
||||
const inputObject = JSON.stringify(
|
||||
{
|
||||
String: "SomeString",
|
||||
Number: 42,
|
||||
iat: 1
|
||||
},
|
||||
null,
|
||||
4
|
||||
);
|
||||
|
||||
const hsKey = "secret_cat";
|
||||
const rsKey = `-----BEGIN RSA PRIVATE KEY-----
|
||||
|
@ -40,35 +44,38 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "JWT Sign: HS256",
|
||||
input: inputObject,
|
||||
expectedOutput: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdHJpbmciOiJTb21lU3RyaW5nIiwiTnVtYmVyIjo0MiwiaWF0IjoxfQ.0ha6-j4FwvEIKPVZ-hf3S_R9Hy_UtXzq4dnedXcUrXk",
|
||||
expectedOutput:
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdHJpbmciOiJTb21lU3RyaW5nIiwiTnVtYmVyIjo0MiwiaWF0IjoxfQ.0ha6-j4FwvEIKPVZ-hf3S_R9Hy_UtXzq4dnedXcUrXk",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [hsKey, "HS256"],
|
||||
args: [hsKey, "HS256"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: HS384",
|
||||
input: inputObject,
|
||||
expectedOutput: "eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJTdHJpbmciOiJTb21lU3RyaW5nIiwiTnVtYmVyIjo0MiwiaWF0IjoxfQ._bPK-Y3mIACConbJqkGFMQ_L3vbxgKXy9gSxtL9hA5XTganozTSXxD0vX0N1yT5s",
|
||||
expectedOutput:
|
||||
"eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJTdHJpbmciOiJTb21lU3RyaW5nIiwiTnVtYmVyIjo0MiwiaWF0IjoxfQ._bPK-Y3mIACConbJqkGFMQ_L3vbxgKXy9gSxtL9hA5XTganozTSXxD0vX0N1yT5s",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [hsKey, "HS384"],
|
||||
args: [hsKey, "HS384"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: HS512",
|
||||
input: inputObject,
|
||||
expectedOutput: "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJTdHJpbmciOiJTb21lU3RyaW5nIiwiTnVtYmVyIjo0MiwiaWF0IjoxfQ.vZIJU4XYMFt3FLE1V_RZOxEetmV4RvxtPZQGzJthK_d47pjwlEb6pQE23YxHFmOj8H5RLEdqqLPw4jNsOyHRzA",
|
||||
expectedOutput:
|
||||
"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJTdHJpbmciOiJTb21lU3RyaW5nIiwiTnVtYmVyIjo0MiwiaWF0IjoxfQ.vZIJU4XYMFt3FLE1V_RZOxEetmV4RvxtPZQGzJthK_d47pjwlEb6pQE23YxHFmOj8H5RLEdqqLPw4jNsOyHRzA",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [hsKey, "HS512"],
|
||||
args: [hsKey, "HS512"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: ES256",
|
||||
|
@ -77,13 +84,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "ES256"],
|
||||
args: [esKey, "ES256"]
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: ES384",
|
||||
|
@ -92,13 +99,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "ES384"],
|
||||
args: [esKey, "ES384"]
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: ES512",
|
||||
|
@ -107,13 +114,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "ES512"],
|
||||
args: [esKey, "ES512"]
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: RS256",
|
||||
|
@ -122,13 +129,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [rsKey, "RS256"],
|
||||
args: [rsKey, "RS256"]
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: RS384",
|
||||
|
@ -137,13 +144,13 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [rsKey, "RS384"],
|
||||
args: [rsKey, "RS384"]
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Sign: RS512",
|
||||
|
@ -152,12 +159,12 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Sign",
|
||||
args: [esKey, "RS512"],
|
||||
args: [esKey, "RS512"]
|
||||
},
|
||||
{
|
||||
op: "JWT Decode",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -8,11 +8,15 @@
|
|||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
const outputObject = JSON.stringify({
|
||||
String: "SomeString",
|
||||
Number: 42,
|
||||
iat: 1
|
||||
}, null, 4);
|
||||
const outputObject = JSON.stringify(
|
||||
{
|
||||
String: "SomeString",
|
||||
Number: 42,
|
||||
iat: 1
|
||||
},
|
||||
null,
|
||||
4
|
||||
);
|
||||
|
||||
const hsKey = "secret_cat";
|
||||
/* Retaining private key as a comment
|
||||
|
@ -58,9 +62,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Verify",
|
||||
args: [hsKey],
|
||||
args: [hsKey]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Verify: RS",
|
||||
|
@ -69,9 +73,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Verify",
|
||||
args: [rsPub],
|
||||
args: [rsPub]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "JWT Verify: ES",
|
||||
|
@ -80,8 +84,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "JWT Verify",
|
||||
args: [esPub],
|
||||
args: [esPub]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,44 +11,36 @@ import TestRegister from "../../lib/TestRegister.mjs";
|
|||
TestRegister.addTests([
|
||||
{
|
||||
name: "Jump: Empty Label",
|
||||
input: [
|
||||
"should be changed",
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"c2hvdWxkIGJlIGNoYW5nZWQ=",
|
||||
].join("\n"),
|
||||
input: ["should be changed"].join("\n"),
|
||||
expectedOutput: ["c2hvdWxkIGJlIGNoYW5nZWQ="].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Jump",
|
||||
args: ["", 10],
|
||||
args: ["", 10]
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
},
|
||||
],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Jump: skips 1",
|
||||
input: [
|
||||
"shouldnt be changed",
|
||||
].join("\n"),
|
||||
expectedOutput: [
|
||||
"shouldnt be changed",
|
||||
].join("\n"),
|
||||
input: ["shouldnt be changed"].join("\n"),
|
||||
expectedOutput: ["shouldnt be changed"].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Jump",
|
||||
args: ["skipReplace", 10],
|
||||
args: ["skipReplace", 10]
|
||||
},
|
||||
{
|
||||
op: "To Base64",
|
||||
args: ["A-Za-z0-9+/="],
|
||||
args: ["A-Za-z0-9+/="]
|
||||
},
|
||||
{
|
||||
op: "Label",
|
||||
args: ["skipReplace"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "LS47 Encrypt",
|
||||
args: ["helloworld", 0, "test"],
|
||||
},
|
||||
],
|
||||
args: ["helloworld", 0, "test"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LS47 Decrypt",
|
||||
|
@ -27,9 +27,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "LS47 Decrypt",
|
||||
args: ["helloworld", 0],
|
||||
},
|
||||
],
|
||||
args: ["helloworld", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LS47 Encrypt",
|
||||
|
@ -38,8 +38,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "LS47 Encrypt",
|
||||
args: ["Helloworld", 0, "test"],
|
||||
},
|
||||
],
|
||||
args: ["Helloworld", 0, "test"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,6 +17,6 @@ TestRegister.addTests([
|
|||
op: "LZNT1 Decompress",
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -17,7 +17,7 @@ TestRegister.addTests([
|
|||
"op": "LZString Compress",
|
||||
"args": ["Base64"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LZString Decompress From Base64",
|
||||
|
@ -28,6 +28,6 @@ TestRegister.addTests([
|
|||
"op": "LZString Decompress",
|
||||
"args": ["Base64"]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -13,11 +13,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, 1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, 1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: Wikipedia example 2",
|
||||
|
@ -26,11 +24,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, 1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, 1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: Wikipedia example 1 with substitution cost 2",
|
||||
|
@ -39,11 +35,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, 1, 2,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, 1, 2]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: varied costs 1",
|
||||
|
@ -52,11 +46,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 10, 100, 1000,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 10, 100, 1000]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: varied costs 2",
|
||||
|
@ -65,11 +57,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1000, 100, 10,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1000, 100, 10]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: another delimiter",
|
||||
|
@ -78,11 +68,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
" ", 1, 1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": [" ", 1, 1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: too few samples",
|
||||
|
@ -91,11 +79,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, 1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, 1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: too many samples",
|
||||
|
@ -104,11 +90,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, 1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, 1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: negative insertion cost",
|
||||
|
@ -117,11 +101,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", -1, 1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", -1, 1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: negative deletion cost",
|
||||
|
@ -130,11 +112,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, -1, 1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, -1, 1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: negative substitution cost",
|
||||
|
@ -143,11 +123,9 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 1, 1, -1,
|
||||
],
|
||||
},
|
||||
],
|
||||
"args": ["\\n", 1, 1, -1]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Levenshtein Distance: cost zero",
|
||||
|
@ -156,10 +134,8 @@ TestRegister.addTests([
|
|||
"recipeConfig": [
|
||||
{
|
||||
"op": "Levenshtein Distance",
|
||||
"args": [
|
||||
"\\n", 0, 0, 0,
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
"args": ["\\n", 0, 0, 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,8 +16,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Luhn Checksum",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Luhn Checksum on standard data 2",
|
||||
|
@ -27,8 +27,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Luhn Checksum",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Luhn Checksum on standard data 3",
|
||||
|
@ -38,8 +38,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Luhn Checksum",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Luhn Checksum on invalid data",
|
||||
|
@ -49,8 +49,8 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Luhn Checksum",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Luhn Checksum on empty data",
|
||||
|
@ -60,7 +60,7 @@ TestRegister.addTests([
|
|||
{
|
||||
op: "Luhn Checksum",
|
||||
args: []
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,12 +11,12 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Microsoft Script Decoder",
|
||||
input: "#@~^RQAAAA==-mD~sX|:/TP{~J:+dYbxL~@!F@*@!+@*@!&@*eEI@#@&@#@&\x7fjm.raY 214Wv:zms/obI0xEAAA==^#~@",
|
||||
expectedOutput: "var my_msg = \"Testing <1><2><3>!\";\r\n\r\nWScript.Echo(my_msg);",
|
||||
expectedOutput: 'var my_msg = "Testing <1><2><3>!";\r\n\r\nWScript.Echo(my_msg);',
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Microsoft Script Decoder",
|
||||
"args": []
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -13,13 +13,14 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Magic: nothing",
|
||||
input: "",
|
||||
expectedOutput: "Nothing of interest could be detected about the input data.\nHave you tried modifying the operation arguments?",
|
||||
expectedOutput:
|
||||
"Nothing of interest could be detected about the input data.\nHave you tried modifying the operation arguments?",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic: hex, correct rank",
|
||||
|
@ -30,7 +31,7 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic: jpeg render",
|
||||
|
@ -41,7 +42,7 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic: mojibake",
|
||||
|
@ -52,7 +53,7 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [1, true, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic: extensive language support, Yiddish",
|
||||
|
@ -63,18 +64,19 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [1, false, true]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic Chain: Base64",
|
||||
input: "WkVkV2VtUkRRbnBrU0Vwd1ltMWpQUT09",
|
||||
expectedMatch: /From_Base64\('A-Za-z0-9\+\/=',true,false\)\nFrom_Base64\('A-Za-z0-9\+\/=',true,false\)\nFrom_Base64\('A-Za-z0-9\+\/=',true,false\)/,
|
||||
expectedMatch:
|
||||
/From_Base64\('A-Za-z0-9\+\/=',true,false\)\nFrom_Base64\('A-Za-z0-9\+\/=',true,false\)\nFrom_Base64\('A-Za-z0-9\+\/=',true,false\)/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic Chain: Hex -> Hexdump -> Base64",
|
||||
|
@ -85,7 +87,7 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic Chain: Charcode -> Octal -> Base32",
|
||||
|
@ -96,7 +98,7 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic Chain: Base64 output",
|
||||
|
@ -107,7 +109,7 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic Chain: Decimal -> Base32 -> Base32",
|
||||
|
@ -118,12 +120,13 @@ TestRegister.addTests([
|
|||
op: "Magic",
|
||||
args: [3, false, false]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Magic: Raw Inflate",
|
||||
input: "\x4d\x52\xb1\x6e\xdc\x30\x0c\xdd\xf3\x15\x44\x80\x6e\xae\x91\x02\x4d\x80\x8e\x4d\x9a\x21\x53\x8b\xa6\x43\x56\x5a\xe2\x9d\x84\x93\x25\x43\x94\xed\xf8\xef\xf3\xe8\x6b\x0e\xb7\x1c\xce\xd4\x7b\x8f\x8f\x7c\x7c\xda\x06\xa9\x4f\x41\x0e\x14\x95\x98\x34\x8e\x53\x92\x8e\x62\x6e\x73\x6c\x71\x11\x5a\x65\x20\x9e\x26\x3a\x94\x4a\x8e\x6b\xdd\x62\x3e\x52\x99\x1b\x71\x4a\x34\x72\xce\x52\xa9\x1c\xe8\xd6\x99\xd0\x2d\x95\x49\x2a\xb7\x58\xb2\xd2\x1a\x5b\x88\x19\xa2\x26\x31\xd4\xb2\xaa\xd4\x9e\xfe\x05\x51\xb9\x86\xc5\xec\xd2\xec\xe5\x7f\x6b\x92\xec\x8a\xb7\x1e\x29\x9e\x84\xde\x7e\xff\x25\x34\x7e\x64\x95\x87\xef\x1d\x8d\xa5\x0a\xb9\x62\xc0\x77\x43\xd6\x6d\x32\x91\x33\xf6\xe7\xf3\x6b\x47\xbf\x9e\x5f\x89\xb3\xa7\xc7\x54\xd6\x43\xd4\xd0\x91\xab\x82\x4e\x10\x1c\x62\xe6\xba\xed\xaf\x41\xde\xfd\x3c\x4e\x8a\x57\x88\x55\x51\x35\x15\x7b\xf1\x72\x5d\xc1\x60\x9e\x1b\x03\xc6\xc9\xcd\xe9\xac\x13\x58\x31\xc3\x8e\x76\x41\xdc\x49\xe7\x11\x42\x2f\x7f\x96\x87\xbd\xf6\xd6\xdf\xdf\xfd\xa0\x89\xab\x02\x0c\x66\xe0\x7c\x34\x1a\xfe\x54\x76\x0d\xeb\xfa\x1c\x11\x2c\x23\x8c\xb3\x0b\xfb\x64\xfd\xcd\x0d\xb6\x43\xad\x94\x64\x69\x78\xd1\x78\xcc\xe2\x51\x00\x85\x07\x2c\x67\x28\x2d\x50\x13\x17\x72\x84\xa3\x9d\x9d\x4b\xfe\x7a\x5d\xe1\xb4\x69\x53\xe3\x20\x9c\x38\x99\x69\xd9\x87\xc0\xa2\x2f\xab\x5b\x79\x3b\xe7\x63\x41\x06\x5e\xcc\x1f\x18\x5e\x20\x61\xe5\x0b\xd0\xbc\xa8\x25\xc0\xe9\x58\x2a\x5e\x46\xed\xe9\xa5\x41\x40\x81\xc9\x4e\x70\x22\xbe\xbb\x58\xed\x68\x98\x63\xc2\x6d\xc0\x18\x72\xad\x32\x4a\x6e\x38\x94\x8d\x10\x6e\x2d\xc0\xd2\x60\x09\x7c\xfa\x34\x4f\x2d\x48\xac\xf4\xed\xee\x0b\x3e\x72\x59\xf6\xab\xa0\x16\x47\x1c\xc9\x82\x65\xa9\xe0\x17\xb6\x36\xc1\x46\xfb\x0f",
|
||||
expectedMatch: /#recipe=Raw_Inflate(.|\n)+CyberChef is a simple, intuitive web app for carrying out all manner of /,
|
||||
expectedMatch:
|
||||
/#recipe=Raw_Inflate(.|\n)+CyberChef is a simple, intuitive web app for carrying out all manner of /,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Magic",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "To Morse Code",
|
||||
args: ["-/.", "Space", "Line feed"],
|
||||
},
|
||||
],
|
||||
args: ["-/.", "Space", "Line feed"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "From Morse Code '... --- ...'",
|
||||
|
@ -27,8 +27,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "From Morse Code",
|
||||
args: ["Space", "Line feed"],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["Space", "Line feed"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -20,11 +20,13 @@ TestRegister.addTests([
|
|||
"EKMFLGDQVZNTOWYHXUSPAIBRCJ<R\nAJDKSIRUXBLHWTMCQGZNPYFVOE<F\nBDFHJLCPRTXVZNYEIWGAKMUSQO<W",
|
||||
"",
|
||||
"AY BR CU DH EQ FS GL IP JX KN MO TZ VW", // B
|
||||
"THISISATESTMESSAGE", 0, false
|
||||
"THISISATESTMESSAGE",
|
||||
0,
|
||||
false
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
/*
|
||||
* This is too slow to run regularly
|
||||
{
|
||||
|
|
|
@ -15,9 +15,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "MurmurHash3",
|
||||
args: [0],
|
||||
},
|
||||
],
|
||||
args: [0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To MurmurHash3: 1",
|
||||
|
@ -26,9 +26,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "MurmurHash3",
|
||||
args: [0],
|
||||
},
|
||||
],
|
||||
args: [0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To MurmurHash3: Hello World!",
|
||||
|
@ -37,9 +37,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "MurmurHash3",
|
||||
args: [0],
|
||||
},
|
||||
],
|
||||
args: [0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To MurmurHash3: Hello World! with seed",
|
||||
|
@ -48,9 +48,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "MurmurHash3",
|
||||
args: [1337],
|
||||
},
|
||||
],
|
||||
args: [1337]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To MurmurHash3: foo",
|
||||
|
@ -59,9 +59,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "MurmurHash3",
|
||||
args: [0],
|
||||
},
|
||||
],
|
||||
args: [0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "To MurmurHash3: foo signed",
|
||||
|
@ -70,8 +70,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "MurmurHash3",
|
||||
args: [0, true],
|
||||
},
|
||||
],
|
||||
args: [0, true]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -15,9 +15,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "NT Hash",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "LM Hash",
|
||||
|
@ -26,9 +26,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "LM Hash",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Encode NetBIOS Name",
|
||||
args: [65],
|
||||
},
|
||||
],
|
||||
args: [65]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Decode NetBIOS Name",
|
||||
|
@ -27,8 +27,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Decode NetBIOS Name",
|
||||
args: [65],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: [65]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,39 +16,41 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFD"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: ["NFD"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Normalise Unicode - NFC",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /\u00C7\u00C7\u2160/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFC"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: ["NFC"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Normalise Unicode - NFKD",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /C\u0327C\u0327I/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFKD"],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: ["NFKD"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Normalise Unicode - NFKC",
|
||||
input: "\u00c7\u0043\u0327\u2160",
|
||||
expectedMatch: /\u00C7\u00C7I/,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Normalise Unicode",
|
||||
args: ["NFKC"],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["NFKC"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -12,12 +12,13 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Generate HOTP",
|
||||
input: "12345678901234567890",
|
||||
expectedOutput: "URI: otpauth://hotp/OTPAuthentication?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\n\nPassword: 755224",
|
||||
expectedOutput:
|
||||
"URI: otpauth://hotp/OTPAuthentication?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\n\nPassword: 755224",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Generate HOTP",
|
||||
args: ["", 32, 6, 0],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: ["", 32, 6, 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -186,7 +186,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "PEMtoHex: EC P-256 Private Key",
|
||||
input: PEMS_EC_P256_PRIVATE_KEY,
|
||||
expectedOutput: "30770201010420885d43140870c9c21c3dd7e16a8dbfe560c9c5a6168119a5197d5f4f9d4fdb87a00a06082a8648ce3d030107a1440342000414b41c05bcc3c1ea3a69fe24de4d2029630d58e6559fcfbd847dabbf80ca29867b135cfae0b06d3e707580ccfef870cac92af6a330f7ff8e9d21b40c5d464aa7",
|
||||
expectedOutput:
|
||||
"30770201010420885d43140870c9c21c3dd7e16a8dbfe560c9c5a6168119a5197d5f4f9d4fdb87a00a06082a8648ce3d030107a1440342000414b41c05bcc3c1ea3a69fe24de4d2029630d58e6559fcfbd847dabbf80ca29867b135cfae0b06d3e707580ccfef870cac92af6a330f7ff8e9d21b40c5d464aa7",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "PEM to Hex",
|
||||
|
@ -197,7 +198,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "PEMtoHex: EC P-256 Private Key PKCS8",
|
||||
input: PEMS_EC_P256_PRIVATE_KEY_PKCS8,
|
||||
expectedOutput: "308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b0201010420885d43140870c9c21c3dd7e16a8dbfe560c9c5a6168119a5197d5f4f9d4fdb87a1440342000414b41c05bcc3c1ea3a69fe24de4d2029630d58e6559fcfbd847dabbf80ca29867b135cfae0b06d3e707580ccfef870cac92af6a330f7ff8e9d21b40c5d464aa7",
|
||||
expectedOutput:
|
||||
"308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b0201010420885d43140870c9c21c3dd7e16a8dbfe560c9c5a6168119a5197d5f4f9d4fdb87a1440342000414b41c05bcc3c1ea3a69fe24de4d2029630d58e6559fcfbd847dabbf80ca29867b135cfae0b06d3e707580ccfef870cac92af6a330f7ff8e9d21b40c5d464aa7",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "PEM to Hex",
|
||||
|
@ -208,7 +210,8 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "PEMtoHex: EC P-256 Public Key",
|
||||
input: PEMS_EC_P256_PUBLIC_KEY,
|
||||
expectedOutput: "3059301306072a8648ce3d020106082a8648ce3d0301070342000414b41c05bcc3c1ea3a69fe24de4d2029630d58e6559fcfbd847dabbf80ca29867b135cfae0b06d3e707580ccfef870cac92af6a330f7ff8e9d21b40c5d464aa7",
|
||||
expectedOutput:
|
||||
"3059301306072a8648ce3d020106082a8648ce3d0301070342000414b41c05bcc3c1ea3a69fe24de4d2029630d58e6559fcfbd847dabbf80ca29867b135cfae0b06d3e707580ccfef870cac92af6a330f7ff8e9d21b40c5d464aa7",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "PEM to Hex",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
import {ASCII_TEXT, UTF8_TEXT, ALL_BYTES} from "../../samples/Ciphers.mjs";
|
||||
import { ASCII_TEXT, UTF8_TEXT, ALL_BYTES } from "../../samples/Ciphers.mjs";
|
||||
|
||||
// RSA-1024
|
||||
const ALICE_PRIVATE = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||
|
|
|
@ -17,9 +17,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "PHP Deserialize",
|
||||
args: [true],
|
||||
},
|
||||
],
|
||||
args: [true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "PHP Deserialize integer",
|
||||
|
@ -28,41 +28,41 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "PHP Deserialize",
|
||||
args: [true],
|
||||
},
|
||||
],
|
||||
args: [true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "PHP Deserialize string",
|
||||
input: "s:17:\"PHP Serialization\";",
|
||||
expectedOutput: "\"PHP Serialization\"",
|
||||
input: 's:17:"PHP Serialization";',
|
||||
expectedOutput: '"PHP Serialization"',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "PHP Deserialize",
|
||||
args: [true],
|
||||
},
|
||||
],
|
||||
args: [true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "PHP Deserialize array (JSON)",
|
||||
input: "a:2:{s:1:\"a\";i:10;i:0;a:1:{s:2:\"ab\";b:1;}}",
|
||||
expectedOutput: "{\"a\": 10,\"0\": {\"ab\": true}}",
|
||||
input: 'a:2:{s:1:"a";i:10;i:0;a:1:{s:2:"ab";b:1;}}',
|
||||
expectedOutput: '{"a": 10,"0": {"ab": true}}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "PHP Deserialize",
|
||||
args: [true],
|
||||
},
|
||||
],
|
||||
args: [true]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "PHP Deserialize array (non-JSON)",
|
||||
input: "a:2:{s:1:\"a\";i:10;i:0;a:1:{s:2:\"ab\";b:1;}}",
|
||||
expectedOutput: "{\"a\": 10,0: {\"ab\": true}}",
|
||||
input: 'a:2:{s:1:"a";i:10;i:0;a:1:{s:2:"ab";b:1;}}',
|
||||
expectedOutput: '{"a": 10,0: {"ab": true}}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "PHP Deserialize",
|
||||
args: [false],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: [false]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -11,79 +11,86 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Parse IPv4 CIDR",
|
||||
input: "10.0.0.0/30",
|
||||
expectedOutput: "Network: 10.0.0.0\nCIDR: 30\nMask: 255.255.255.252\nRange: 10.0.0.0 - 10.0.0.3\nTotal addresses in range: 4\n\n10.0.0.0\n10.0.0.1\n10.0.0.2\n10.0.0.3",
|
||||
expectedOutput:
|
||||
"Network: 10.0.0.0\nCIDR: 30\nMask: 255.255.255.252\nRange: 10.0.0.0 - 10.0.0.3\nTotal addresses in range: 4\n\n10.0.0.0\n10.0.0.1\n10.0.0.2\n10.0.0.3",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse IPv4 hyphenated",
|
||||
input: "10.0.0.0 - 10.0.0.3",
|
||||
expectedOutput: "Minimum subnet required to hold this range:\n\tNetwork: 10.0.0.0\n\tCIDR: 30\n\tMask: 255.255.255.252\n\tSubnet range: 10.0.0.0 - 10.0.0.3\n\tTotal addresses in subnet: 4\n\nRange: 10.0.0.0 - 10.0.0.3\nTotal addresses in range: 4\n\n10.0.0.0\n10.0.0.1\n10.0.0.2\n10.0.0.3",
|
||||
expectedOutput:
|
||||
"Minimum subnet required to hold this range:\n\tNetwork: 10.0.0.0\n\tCIDR: 30\n\tMask: 255.255.255.252\n\tSubnet range: 10.0.0.0 - 10.0.0.3\n\tTotal addresses in subnet: 4\n\nRange: 10.0.0.0 - 10.0.0.3\nTotal addresses in range: 4\n\n10.0.0.0\n10.0.0.1\n10.0.0.2\n10.0.0.3",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse IPv4 list",
|
||||
input: "10.0.0.8\n10.0.0.5/30\n10.0.0.1\n10.0.0.3",
|
||||
expectedOutput: "Minimum subnet required to hold this range:\n\tNetwork: 10.0.0.0\n\tCIDR: 28\n\tMask: 255.255.255.240\n\tSubnet range: 10.0.0.0 - 10.0.0.15\n\tTotal addresses in subnet: 16\n\nRange: 10.0.0.1 - 10.0.0.8\nTotal addresses in range: 8\n\n10.0.0.1\n10.0.0.2\n10.0.0.3\n10.0.0.4\n10.0.0.5\n10.0.0.6\n10.0.0.7\n10.0.0.8",
|
||||
expectedOutput:
|
||||
"Minimum subnet required to hold this range:\n\tNetwork: 10.0.0.0\n\tCIDR: 28\n\tMask: 255.255.255.240\n\tSubnet range: 10.0.0.0 - 10.0.0.15\n\tTotal addresses in subnet: 16\n\nRange: 10.0.0.1 - 10.0.0.8\nTotal addresses in range: 8\n\n10.0.0.1\n10.0.0.2\n10.0.0.3\n10.0.0.4\n10.0.0.5\n10.0.0.6\n10.0.0.7\n10.0.0.8",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse IPv6 CIDR - full",
|
||||
input: "2404:6800:4001:0000:0000:0000:0000:0000/48",
|
||||
expectedOutput: "Network: 2404:6800:4001:0000:0000:0000:0000:0000\nShorthand: 2404:6800:4001::\nCIDR: 48\nMask: ffff:ffff:ffff:0000:0000:0000:0000:0000\nRange: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
expectedOutput:
|
||||
"Network: 2404:6800:4001:0000:0000:0000:0000:0000\nShorthand: 2404:6800:4001::\nCIDR: 48\nMask: ffff:ffff:ffff:0000:0000:0000:0000:0000\nRange: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse IPv6 CIDR - collapsed",
|
||||
input: "2404:6800:4001::/48",
|
||||
expectedOutput: "Network: 2404:6800:4001:0000:0000:0000:0000:0000\nShorthand: 2404:6800:4001::\nCIDR: 48\nMask: ffff:ffff:ffff:0000:0000:0000:0000:0000\nRange: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
expectedOutput:
|
||||
"Network: 2404:6800:4001:0000:0000:0000:0000:0000\nShorthand: 2404:6800:4001::\nCIDR: 48\nMask: ffff:ffff:ffff:0000:0000:0000:0000:0000\nRange: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse IPv6 hyphenated",
|
||||
input: "2404:6800:4001:: - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff",
|
||||
expectedOutput: "Range: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nShorthand range: 2404:6800:4001:: - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
expectedOutput:
|
||||
"Range: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nShorthand range: 2404:6800:4001:: - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse IPv6 list",
|
||||
input: "2404:6800:4001:ffff:ffff:ffff:ffff:ffff\n2404:6800:4001::ffff\n2404:6800:4001:ffff:ffff::1111\n2404:6800:4001::/64",
|
||||
expectedOutput: "Range: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nShorthand range: 2404:6800:4001:: - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
expectedOutput:
|
||||
"Range: 2404:6800:4001:0000:0000:0000:0000:0000 - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nShorthand range: 2404:6800:4001:: - 2404:6800:4001:ffff:ffff:ffff:ffff:ffff\nTotal addresses in range: 1.2089258196146292e+24\n\n",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "IPv4 subnet out of range error",
|
||||
|
@ -93,8 +100,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "invalid IPv4 address error",
|
||||
|
@ -104,8 +111,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "IPv6 subnet out of range error",
|
||||
|
@ -115,18 +122,19 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "invalid IPv6 address error",
|
||||
input: "2404:6800:4001:/12",
|
||||
expectedOutput: "Invalid input.\n\nEnter either a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0). IPv6 also supported.",
|
||||
expectedOutput:
|
||||
"Invalid input.\n\nEnter either a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0). IPv6 also supported.",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse IP range",
|
||||
"args": [true, true, false]
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Parse ISO timestamp from ObjectId",
|
||||
|
@ -17,8 +16,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Parse ObjectID timestamp",
|
||||
args: [],
|
||||
args: []
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -35,8 +35,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Parse QR Code",
|
||||
"args": [false]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse QR Code : Transparent PNG",
|
||||
|
@ -50,8 +50,8 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "Parse QR Code",
|
||||
"args": [true]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse QR Code : Angled code",
|
||||
|
|
|
@ -15,9 +15,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Parse TCP",
|
||||
args: ["Hex"],
|
||||
args: ["Hex"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse TCP: Options",
|
||||
|
@ -26,9 +26,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Parse TCP",
|
||||
args: ["Hex"],
|
||||
args: ["Hex"]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse TCP: Timestamps",
|
||||
|
@ -37,8 +37,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Parse TCP",
|
||||
args: ["Hex"],
|
||||
args: ["Hex"]
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -12,7 +12,15 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Parse TLV: LengthValue",
|
||||
input: "\x05\x48\x6f\x75\x73\x65\x04\x72\x6f\x6f\x6d\x04\x64\x6f\x6f\x72",
|
||||
expectedOutput: JSON.stringify([{"length": 5, "value": [72, 111, 117, 115, 101]}, {"length": 4, "value": [114, 111, 111, 109]}, {"length": 4, "value": [100, 111, 111, 114]}], null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
[
|
||||
{ "length": 5, "value": [72, 111, 117, 115, 101] },
|
||||
{ "length": 4, "value": [114, 111, 111, 109] },
|
||||
{ "length": 4, "value": [100, 111, 111, 114] }
|
||||
],
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse TLV",
|
||||
|
@ -23,7 +31,15 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Parse TLV: LengthValue with BER",
|
||||
input: "\x05\x48\x6f\x75\x73\x65\x04\x72\x6f\x6f\x6d\x04\x64\x6f\x6f\x72",
|
||||
expectedOutput: JSON.stringify([{"length": 5, "value": [72, 111, 117, 115, 101]}, {"length": 4, "value": [114, 111, 111, 109]}, {"length": 4, "value": [100, 111, 111, 114]}], null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
[
|
||||
{ "length": 5, "value": [72, 111, 117, 115, 101] },
|
||||
{ "length": 4, "value": [114, 111, 111, 109] },
|
||||
{ "length": 4, "value": [100, 111, 111, 114] }
|
||||
],
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse TLV",
|
||||
|
@ -34,7 +50,15 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Parse TLV: KeyLengthValue",
|
||||
input: "\x04\x05\x48\x6f\x75\x73\x65\x05\x04\x72\x6f\x6f\x6d\x42\x04\x64\x6f\x6f\x72",
|
||||
expectedOutput: JSON.stringify([{"key": [4], "length": 5, "value": [72, 111, 117, 115, 101]}, {"key": [5], "length": 4, "value": [114, 111, 111, 109]}, {"key": [66], "length": 4, "value": [100, 111, 111, 114]}], null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
[
|
||||
{ "key": [4], "length": 5, "value": [72, 111, 117, 115, 101] },
|
||||
{ "key": [5], "length": 4, "value": [114, 111, 111, 109] },
|
||||
{ "key": [66], "length": 4, "value": [100, 111, 111, 114] }
|
||||
],
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse TLV",
|
||||
|
@ -45,7 +69,15 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Parse TLV: KeyLengthValue with BER",
|
||||
input: "\x04\x05\x48\x6f\x75\x73\x65\x05\x04\x72\x6f\x6f\x6d\x42\x04\x64\x6f\x6f\x72",
|
||||
expectedOutput: JSON.stringify([{"key": [4], "length": 5, "value": [72, 111, 117, 115, 101]}, {"key": [5], "length": 4, "value": [114, 111, 111, 109]}, {"key": [66], "length": 4, "value": [100, 111, 111, 114]}], null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
[
|
||||
{ "key": [4], "length": 5, "value": [72, 111, 117, 115, 101] },
|
||||
{ "key": [5], "length": 4, "value": [114, 111, 111, 109] },
|
||||
{ "key": [66], "length": 4, "value": [100, 111, 111, 114] }
|
||||
],
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse TLV",
|
||||
|
|
|
@ -11,31 +11,32 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Parse UDP: No Data - JSON",
|
||||
input: "04 89 00 35 00 2c 01 01",
|
||||
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"0x0101\"}",
|
||||
expectedOutput: '{"Source port":1161,"Destination port":53,"Length":44,"Checksum":"0x0101"}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Parse UDP",
|
||||
args: ["Hex"],
|
||||
args: ["Hex"]
|
||||
},
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
}, {
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse UDP: With Data - JSON",
|
||||
input: "04 89 00 35 00 2c 01 01 02 02",
|
||||
expectedOutput: "{\"Source port\":1161,\"Destination port\":53,\"Length\":44,\"Checksum\":\"0x0101\",\"Data\":\"0x0202\"}",
|
||||
expectedOutput: '{"Source port":1161,"Destination port":53,"Length":44,"Checksum":"0x0101","Data":"0x0202"}',
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Parse UDP",
|
||||
args: ["Hex"],
|
||||
args: ["Hex"]
|
||||
},
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse UDP: Not Enough Bytes",
|
||||
|
@ -44,12 +45,12 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Parse UDP",
|
||||
args: ["Hex"],
|
||||
args: ["Hex"]
|
||||
},
|
||||
{
|
||||
op: "JSON Minify",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
args: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -16,9 +16,9 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Power Set",
|
||||
args: [","],
|
||||
},
|
||||
],
|
||||
args: [","]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Power set",
|
||||
|
@ -27,8 +27,8 @@ TestRegister.addTests([
|
|||
recipeConfig: [
|
||||
{
|
||||
op: "Power Set",
|
||||
args: [" "],
|
||||
},
|
||||
],
|
||||
},
|
||||
args: [" "]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -12,16 +12,20 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Protobuf Decode: no schema",
|
||||
input: "0d1c0000001203596f751a024d65202b2a0a0a066162633132331200",
|
||||
expectedOutput: JSON.stringify({
|
||||
"1": 28,
|
||||
"2": "You",
|
||||
"3": "Me",
|
||||
"4": 43,
|
||||
"5": {
|
||||
"1": "abc123",
|
||||
"2": {}
|
||||
}
|
||||
}, null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
{
|
||||
"1": 28,
|
||||
"2": "You",
|
||||
"3": "Me",
|
||||
"4": 43,
|
||||
"5": {
|
||||
"1": "abc123",
|
||||
"2": {}
|
||||
}
|
||||
},
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -36,15 +40,15 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Protobuf Decode: partial schema, no unknown fields",
|
||||
input: "0d1c0000001203596f751a024d65202b2a0a0a066162633132331200",
|
||||
expectedOutput: JSON.stringify({
|
||||
"Apple": [
|
||||
28
|
||||
],
|
||||
"Carrot": [
|
||||
"Me"
|
||||
],
|
||||
"Banana": "You"
|
||||
}, null, 4),
|
||||
expectedOutput: JSON.stringify(
|
||||
{
|
||||
"Apple": [28],
|
||||
"Carrot": ["Me"],
|
||||
"Banana": "You"
|
||||
},
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -67,24 +71,24 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Protobuf Decode: partial schema, show unknown fields",
|
||||
input: "0d1c0000001203596f751a024d65202b2a0a0a066162633132331200",
|
||||
expectedOutput: JSON.stringify({
|
||||
"Test": {
|
||||
"Apple": [
|
||||
28
|
||||
],
|
||||
"Carrot": [
|
||||
"Me"
|
||||
],
|
||||
"Banana": "You"
|
||||
},
|
||||
"Unknown Fields": {
|
||||
"4": 43,
|
||||
"5": {
|
||||
"1": "abc123",
|
||||
"2": {}
|
||||
expectedOutput: JSON.stringify(
|
||||
{
|
||||
"Test": {
|
||||
"Apple": [28],
|
||||
"Carrot": ["Me"],
|
||||
"Banana": "You"
|
||||
},
|
||||
"Unknown Fields": {
|
||||
"4": 43,
|
||||
"5": {
|
||||
"1": "abc123",
|
||||
"2": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, null, 4),
|
||||
},
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -107,21 +111,21 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Protobuf Decode: full schema, no unknown fields",
|
||||
input: "0d1c0000001203596f751a024d65202b2a0a0a06616263313233120031ff00000000000000",
|
||||
expectedOutput: JSON.stringify({
|
||||
"Apple": [
|
||||
28
|
||||
],
|
||||
"Carrot": [
|
||||
"Me"
|
||||
],
|
||||
"Banana": "You",
|
||||
"Date": 43,
|
||||
"Elderberry": {
|
||||
"Fig": "abc123",
|
||||
"Grape": {}
|
||||
expectedOutput: JSON.stringify(
|
||||
{
|
||||
"Apple": [28],
|
||||
"Carrot": ["Me"],
|
||||
"Banana": "You",
|
||||
"Date": 43,
|
||||
"Elderberry": {
|
||||
"Fig": "abc123",
|
||||
"Grape": {}
|
||||
},
|
||||
"Huckleberry": 255
|
||||
},
|
||||
"Huckleberry": 255
|
||||
}, null, 4),
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -152,24 +156,26 @@ TestRegister.addTests([
|
|||
{
|
||||
name: "Protobuf Decode: partial schema, show unknown fields, show types",
|
||||
input: "0d1c0000001203596f751a024d65202b2a0a0a06616263313233120031ba32a96cc10200003801",
|
||||
expectedOutput: JSON.stringify({
|
||||
"Test": {
|
||||
"Carrot (string)": [
|
||||
"Me"
|
||||
],
|
||||
"Banana (string)": "You",
|
||||
"Date (int32)": 43,
|
||||
"Imbe (Options)": "Option1"
|
||||
},
|
||||
"Unknown Fields": {
|
||||
"field #1: 32-Bit (e.g. fixed32, float)": 28,
|
||||
"field #5: L-delim (e.g. string, message)": {
|
||||
"field #1: L-delim (e.g. string, message)": "abc123",
|
||||
"field #2: L-delim (e.g. string, message)": {}
|
||||
expectedOutput: JSON.stringify(
|
||||
{
|
||||
"Test": {
|
||||
"Carrot (string)": ["Me"],
|
||||
"Banana (string)": "You",
|
||||
"Date (int32)": 43,
|
||||
"Imbe (Options)": "Option1"
|
||||
},
|
||||
"field #6: 64-Bit (e.g. fixed64, double)": 3029774971578
|
||||
}
|
||||
}, null, 4),
|
||||
"Unknown Fields": {
|
||||
"field #1: 32-Bit (e.g. fixed32, float)": 28,
|
||||
"field #5: L-delim (e.g. string, message)": {
|
||||
"field #1: L-delim (e.g. string, message)": "abc123",
|
||||
"field #2: L-delim (e.g. string, message)": {}
|
||||
},
|
||||
"field #6: 64-Bit (e.g. fixed64, double)": 3029774971578
|
||||
}
|
||||
},
|
||||
null,
|
||||
4
|
||||
),
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
|
@ -202,22 +208,22 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
name: "Protobuf Encode",
|
||||
input: JSON.stringify({
|
||||
"Apple": [
|
||||
28
|
||||
],
|
||||
"Banana": "You",
|
||||
"Carrot": [
|
||||
"Me"
|
||||
],
|
||||
"Date": 43,
|
||||
"Elderberry": {
|
||||
"Fig": "abc123",
|
||||
"Grape": {}
|
||||
input: JSON.stringify(
|
||||
{
|
||||
"Apple": [28],
|
||||
"Banana": "You",
|
||||
"Carrot": ["Me"],
|
||||
"Date": 43,
|
||||
"Elderberry": {
|
||||
"Fig": "abc123",
|
||||
"Grape": {}
|
||||
},
|
||||
"Huckleberry": [3029774971578],
|
||||
"Imbe": 1
|
||||
},
|
||||
"Huckleberry": [3029774971578],
|
||||
"Imbe": 1
|
||||
}, null, 4),
|
||||
null,
|
||||
4
|
||||
),
|
||||
expectedOutput: "0d1c0000001203596f751a024d65202b2a0a0a06616263313233120031ba32a96cc10200003801",
|
||||
recipeConfig: [
|
||||
{
|
||||
|
@ -246,31 +252,28 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": [
|
||||
"None",
|
||||
0
|
||||
]
|
||||
"args": ["None", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Protobuf Encode: incomplete schema",
|
||||
input: JSON.stringify({
|
||||
"Apple": [
|
||||
28
|
||||
],
|
||||
"Banana": "You",
|
||||
"Carrot": [
|
||||
"Me"
|
||||
],
|
||||
"Date": 43,
|
||||
"Elderberry": {
|
||||
"Fig": "abc123",
|
||||
"Grape": {}
|
||||
input: JSON.stringify(
|
||||
{
|
||||
"Apple": [28],
|
||||
"Banana": "You",
|
||||
"Carrot": ["Me"],
|
||||
"Date": 43,
|
||||
"Elderberry": {
|
||||
"Fig": "abc123",
|
||||
"Grape": {}
|
||||
},
|
||||
"Huckleberry": [3029774971578],
|
||||
"Imbe": 1
|
||||
},
|
||||
"Huckleberry": [3029774971578],
|
||||
"Imbe": 1
|
||||
}, null, 4),
|
||||
null,
|
||||
4
|
||||
),
|
||||
expectedOutput: "1203596f75202b2a0a0a06616263313233120031ba32a96cc1020000",
|
||||
recipeConfig: [
|
||||
{
|
||||
|
@ -296,11 +299,8 @@ TestRegister.addTests([
|
|||
},
|
||||
{
|
||||
"op": "To Hex",
|
||||
"args": [
|
||||
"None",
|
||||
0
|
||||
]
|
||||
"args": ["None", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* RAKE, Rapid Automatic Keyword Extraction tests.
|
||||
*
|
||||
*
|
||||
* @author sw5678
|
||||
* @copyright Crown Copyright 2024
|
||||
* @license Apache-2.0
|
||||
|
@ -16,7 +16,7 @@ TestRegister.addTests([
|
|||
{
|
||||
"op": "RAKE",
|
||||
"args": ["\\s", "\\.\\s|\\n", "i,me,my,myself,we,our"]
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue