mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00

This adds operations + "To EBCDIC" + "From EBCDIC" This makes use of the npm codepage package but it is not installed as a dependency. Instead I used the `make.sh` script to export pages 37 and 500. To my knowledge there is no way currently to only import individual code pages from the npm package (hence the included script). If we were to import the package directly it increases the build size by 2.7MB.
56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
/**
|
|
* CharEnc tests.
|
|
*
|
|
* @author tlwr [toby@toby.codes]
|
|
* @copyright Crown Copyright 2017
|
|
* @license Apache-2.0
|
|
*/
|
|
import TestRegister from "../../TestRegister.js";
|
|
|
|
TestRegister.addTests([
|
|
{
|
|
name: "From EBCDIC: nothing",
|
|
input: "",
|
|
expectedOutput: "",
|
|
recipeConfig: [
|
|
{
|
|
"op": "From Hex",
|
|
"args": ["Space"]
|
|
},
|
|
{
|
|
"op": "From EBCDIC",
|
|
"args": ["IBM EBCDIC International"]
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "From EBCDIC: hello",
|
|
input: "88 85 93 93 96",
|
|
expectedOutput: "hello",
|
|
recipeConfig: [
|
|
{
|
|
"op": "From Hex",
|
|
"args": ["Space"]
|
|
},
|
|
{
|
|
"op": "From EBCDIC",
|
|
"args": ["IBM EBCDIC International"]
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "To EBCDIC: hello",
|
|
input: "hello",
|
|
expectedOutput: "88 85 93 93 96",
|
|
recipeConfig: [
|
|
{
|
|
"op": "To EBCDIC",
|
|
"args": ["IBM EBCDIC International"]
|
|
},
|
|
{
|
|
"op": "To Hex",
|
|
"args": ["Space"]
|
|
},
|
|
],
|
|
},
|
|
]);
|