Merge branch 'master' into fix/jsonata-base64-web-worker

This commit is contained in:
min23asdw 2026-03-24 11:02:33 +07:00 committed by GitHub
commit 8b34c824aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 46 additions and 4 deletions

View File

@ -1 +0,0 @@
<!-- Prefix the title above with 'Misc:' -->

View File

@ -7,8 +7,14 @@ assignees: ''
--- ---
## Summary **Is your operation request related to a problem? Please describe.**
A clear and concise description of what the problem is. E.g. I'm always frustrated when [...]
### Example Input **Describe the solution you'd like**
A clear and concise description of the new operation you would like.
### Example Output **Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Example input and output**
Provide an example input to the operation, along with the output that you would expect.

15
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,15 @@
**Description**
Provide a description of the pull request and the changes that it makes.
**Existing Issue**
If this pull request relates to an existing issue in the repository, please link it here.
**Screenshots**
If the pull request changes any visual aspects of CyberChef, please include screenshots.
**AI disclosure**
If you have used any AI tools while creating this code, **you must declare your usage along with the name of the tools that you used**.
Regardless of AI tool usage, you are responsible for any code that you submit, and we expect you to have checked the code and have enough of an understanding of it to answer any questions we might have.
**Test Coverage**
Please ensure you have added test coverage for your changes.

View File

@ -50,6 +50,7 @@ const HEX_ALPHABET_MAP = HEX_ALPHABET.split("");
export function toModhex(data, delim=" ", padding=2, extraDelim="", lineSize=0) { export function toModhex(data, delim=" ", padding=2, extraDelim="", lineSize=0) {
if (!data) return ""; if (!data) return "";
if (data instanceof ArrayBuffer) data = new Uint8Array(data); if (data instanceof ArrayBuffer) data = new Uint8Array(data);
if (data.length === 0) return "";
const regularHexString = toHex(data, "", padding, "", 0); const regularHexString = toHex(data, "", padding, "", 0);
@ -100,6 +101,7 @@ export function toModhex(data, delim=" ", padding=2, extraDelim="", lineSize=0)
export function toModhexFast(data) { export function toModhexFast(data) {
if (!data) return ""; if (!data) return "";
if (data instanceof ArrayBuffer) data = new Uint8Array(data); if (data instanceof ArrayBuffer) data = new Uint8Array(data);
if (data.length === 0) return "";
const output = []; const output = [];

View File

@ -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
]
}
]
},
]); ]);