mirror of
https://github.com/gchq/CyberChef.git
synced 2026-03-17 04:11:51 -07:00
Merge 17d543aae5 into 4deaa0de20
This commit is contained in:
commit
ae8c933d3d
2 changed files with 22 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ const HEX_ALPHABET_MAP = HEX_ALPHABET.split("");
|
|||
export function toModhex(data, delim=" ", padding=2, extraDelim="", lineSize=0) {
|
||||
if (!data) return "";
|
||||
if (data instanceof ArrayBuffer) data = new Uint8Array(data);
|
||||
if (data.length === 0) return "";
|
||||
|
||||
const regularHexString = toHex(data, "", padding, "", 0);
|
||||
|
||||
|
|
@ -100,6 +101,7 @@ export function toModhex(data, delim=" ", padding=2, extraDelim="", lineSize=0)
|
|||
export function toModhexFast(data) {
|
||||
if (!data) return "";
|
||||
if (data instanceof ArrayBuffer) data = new Uint8Array(data);
|
||||
if (data.length === 0) return "";
|
||||
|
||||
const output = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -147,4 +147,24 @@ dc;ii;hv;ig;hr;hf;dc;he;hj;hv;hv;ie;hg;du",
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Empty input through From Hex and To Modhex returns empty output",
|
||||
input: "",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "From Hex",
|
||||
"args": [
|
||||
"Auto"
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "To Modhex",
|
||||
"args": [
|
||||
"Space",
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue