mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 16:56:15 -04:00
Merge branch 'base45' of https://github.com/t-8ch/CyberChef into t-8ch-base45
This commit is contained in:
commit
709b8696fc
7 changed files with 313 additions and 0 deletions
|
@ -20,6 +20,7 @@ import TestRegister from "../lib/TestRegister.mjs";
|
|||
import "./tests/BCD.mjs";
|
||||
import "./tests/BSON.mjs";
|
||||
import "./tests/BaconCipher.mjs";
|
||||
import "./tests/Base45.mjs";
|
||||
import "./tests/Base58.mjs";
|
||||
import "./tests/Base64.mjs";
|
||||
import "./tests/Base62.mjs";
|
||||
|
|
101
tests/operations/tests/Base45.mjs
Normal file
101
tests/operations/tests/Base45.mjs
Normal file
|
@ -0,0 +1,101 @@
|
|||
/**
|
||||
* Base45 tests.
|
||||
*
|
||||
* @author Thomas Weißschuh [thomas@t-8ch.de]
|
||||
*
|
||||
* @copyright Crown Copyright 2021
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "To Base45: nothing",
|
||||
input: "",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "To Base45: Spec encoding example 1",
|
||||
input: "AB",
|
||||
expectedOutput: "BB8",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "To Base45: Spec encoding example 2",
|
||||
input: "Hello!!",
|
||||
expectedOutput: "%69 VD92EX0",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "To Base45: Spec encoding example 3",
|
||||
input: "base-45",
|
||||
expectedOutput: "UJCLQE7W581",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "From Base45: nothing",
|
||||
input: "",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "From Base45: Spec decoding example 1",
|
||||
input: "QED8WEX0",
|
||||
expectedOutput: "ietf!",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "From Base45: Invalid character",
|
||||
input: "!",
|
||||
expectedOutput: "Character not in alphabet: '!'",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "From Base45: Invalid triplet value",
|
||||
input: "ZZZ",
|
||||
expectedOutput: "Triplet too large: 'ZZZ'",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Base45",
|
||||
args: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue