add boolean args

removeNonAlphChars, strictMode
This commit is contained in:
wjaaaaaaat 2025-02-17 14:54:35 -05:00 committed by GitHub
parent d9fb3e28dd
commit 58b0d06760
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,6 +30,16 @@ class FromHex extends Operation {
name: "Delimiter", name: "Delimiter",
type: "option", type: "option",
value: FROM_HEX_DELIM_OPTIONS value: FROM_HEX_DELIM_OPTIONS
},
{
name: "Remove non-alphabet chars",
type: "boolean",
value: true
},
{
name: "Strict mode",
type: "boolean",
value: false
} }
]; ];
this.checks = [ this.checks = [
@ -92,8 +102,8 @@ class FromHex extends Operation {
* @returns {byteArray} * @returns {byteArray}
*/ */
run(input, args) { run(input, args) {
const delim = args[0] || "Auto"; const [delim, removeNonAlphChars, strictMode] = [args[0] || "Auto", args[1], args[2]];
return fromHex(input, delim, 2); return fromHex(input, delim, 2, removeNonAlphChars, strictMode);
} }
/** /**