Aligned Field Offset Table
Lay out explicit byte field lengths with per-field integer alignment and report every padding gap; no ABI inference.
Description
Lay out explicit byte field lengths with per-field integer alignment and report every padding gap; no ABI inference.
Aligned fields may need padding before each field, based on its absolute offset rather than its own length.
When to use this tool
Lay out explicit byte field lengths with per-field integer alignment and report every padding gap; no ABI inference.
- Prepare the supplied lengths, alignments, initialOffset 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 lengths, alignments, initialOffset. 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, result.endOffset. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require aligned lengths/alignments, nonnegative integer initialOffset and lengths, and positive integer alignments. Add nonnegative modulo(-offset,alignment), record start/end/padding, then advance by length.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| lengths | lengths. | List of finite numbers; at most 128 entries |
| alignments | alignments. | List of finite numbers; at most 128 entries |
| initialOffset | initial offset. | Integer from 0 to 1e9 inclusive |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.fields | The fields list in the ordering and representation described above. |
| result.endOffset | The end offset value under the stated formula or text convention. |
{
"input": {
"lengths": [
1,
2
],
"alignments": [
1,
4
],
"initialOffset": 0
},
"output": {
"result": {
"fields": [
{
"start": 0,
"end": 1,
"padding": 0
},
{
"start": 4,
"end": 6,
"padding": 3
}
],
"endOffset": 6
}
}
} Limitations and assumptions
- Alignments need not be powers of two. No final structure alignment, implicit header or actual memory allocation is added.
- 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 Field Slice Table
Slice explicitly bounded half-open byte field spans; overlaps remain allowed and observable.
- Byte Range Bit Offset
Map a nonnegative half-open byte range to bit offsets; empty ranges stay empty.