mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 00:36:16 -04:00
Add "{To,From} EBCDIC" operations
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.
This commit is contained in:
parent
31e5d785fe
commit
3c15bd9e29
5 changed files with 662 additions and 0 deletions
56
test/tests/operations/CharEnc.js
Normal file
56
test/tests/operations/CharEnc.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* 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"]
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue