Add line size formatting and comma separation

This commit is contained in:
Andy Wang 2020-01-15 00:14:43 +00:00
parent f7be8d720b
commit 597fba2fd0
2 changed files with 38 additions and 10 deletions

View file

@ -30,6 +30,16 @@ class ToHex extends Operation {
name: "Delimiter",
type: "option",
value: TO_HEX_DELIM_OPTIONS
},
{
name: "Bytes per line",
type: "number",
value: 0
},
{
name: "Comma separated",
type: "boolean",
value: false
}
];
}
@ -41,7 +51,8 @@ class ToHex extends Operation {
*/
run(input, args) {
const delim = Utils.charRep(args[0] || "Space");
return toHex(new Uint8Array(input), delim, 2);
const comma = args[2] ? "," : "";
return toHex(new Uint8Array(input), delim, 2, comma, args[1]);
}
/**