Byte Array Field Slice Table
Slice explicitly bounded half-open byte field spans; overlaps remain allowed and observable.
Description
Slice explicitly bounded half-open byte field spans; overlaps remain allowed and observable.
A byte-field slice table can retain positions as well as the selected bytes. Fields may intentionally overlap.
When to use this tool
Slice explicitly bounded half-open byte field spans; overlaps remain allowed and observable.
- Prepare the supplied bytes, spansJson fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter bytes, spansJson. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.fields. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Parse spansJson as ordered integer [start,end] pairs within bytes length. Return each span and the corresponding half-open slice in supplied order.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| bytes | bytes. | List of integers from 0 to 255; at most 128 bytes |
| spansJson | JSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file. | Text |
For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.
[
{
"field": "spansJson",
"decoded": [
[
1,
3
]
]
}
] | Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.fields | The fields list in the ordering and representation described above. |
{
"input": {
"bytes": [
10,
20,
30
],
"spansJson": "[[1,3]]"
},
"output": {
"result": {
"fields": [
{
"start": 1,
"end": 3,
"bytes": [
20,
30
]
}
]
}
}
} Limitations and assumptions
- Zero-length and overlapping slices are accepted. No field schema, endian conversion or coverage requirement is inferred.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Lists are limited to 128 entries. JSON text must meet bounded size and depth checks, and numeric outputs beyond the safe finite magnitude are rejected. Exact large integers use decimal strings.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Retain the field-width, bit-index and byte-order conventions when combining operations. Slicing, escaping, permutation and alignment are separate transforms; none supplies a complete framing or cryptographic protocol.
References
Similar or alternative tools
- Byte Array Escaping Inverse
Explicit byte-stuffing inverse with escape followed by reserved byte XOR 0x20; escape and sentinel must differ.
- Byte Array Escaping Transform
Explicit byte-stuffing transform with escape followed by reserved byte XOR 0x20; escape and sentinel must differ.