Merge branch 'binaryLength' of https://github.com/n1073645/CyberChef into n1073645-binaryLength
This commit is contained in:
commit
a41b1c2f5e
@ -31,6 +31,11 @@ class FromBinary extends Operation {
|
|||||||
"name": "Delimiter",
|
"name": "Delimiter",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": BIN_DELIM_OPTIONS
|
"value": BIN_DELIM_OPTIONS
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Byte Length",
|
||||||
|
"type": "number",
|
||||||
|
"value": 8
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
this.checks = [
|
this.checks = [
|
||||||
@ -78,7 +83,8 @@ class FromBinary extends Operation {
|
|||||||
* @returns {byteArray}
|
* @returns {byteArray}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
return fromBinary(input, args[0]);
|
const byteLen = args[1] ? args[1] : 8;
|
||||||
|
return fromBinary(input, args[0], byteLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,6 +31,11 @@ class ToBinary extends Operation {
|
|||||||
"name": "Delimiter",
|
"name": "Delimiter",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": BIN_DELIM_OPTIONS
|
"value": BIN_DELIM_OPTIONS
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Byte Length",
|
||||||
|
"type": "number",
|
||||||
|
"value": 8
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -42,7 +47,8 @@ class ToBinary extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
input = new Uint8Array(input);
|
input = new Uint8Array(input);
|
||||||
return toBinary(input, args[0]);
|
const padding = args[1] ? args[1] : 8;
|
||||||
|
return toBinary(input, args[0], padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user