bytes_edit
Edit hex byte buffers by padding, trimming, slicing, concatenating, sizing, or adding/removing 0x prefix. Returns modified buffer and its byte length.
Instructions
Edit a hex byte-buffer: pad/trim to width, slice, concat, size, or 0x-prefix.
data is hex (a leading 0x is optional). Actions:
pad: widen to
lengthbytes with thefillbyte onside(left=prepend, right=append); never truncates if already wider.trim: strip the
fillbyte (default 00) fromside(left=leading, right=trailing) — the inverse of pad.slice: take
data[start:end](Python indexing; negatives allowed).concat: append each hex buffer in
partstodata.size: report the byte length, buffer unchanged.
prefix: side=left adds a 0x prefix, side=right strips it.
Returns {action, result, size}: result is the 0x-prefixed hex buffer (bare
hex when prefix-stripping), size its byte length.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| data | Yes | ||
| length | No | ||
| start | No | ||
| end | No | ||
| parts | No | ||
| side | No | left | |
| fill | No | 00 |