Add line size formatting and comma separation
This commit is contained in:
1 parent
f7be8d720b
commit
597fba2fd0
2 files changed
+38
-10
No files matched your search
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user