Description
Round a chunk length of 4-65535 bytes up to a multiple of four.
A wire-format length may count headers, payload, padding, or only part of an enclosing message. Offsets and exclusive ends must use a clearly stated byte convention.
Round a chunk length of 4-65535 bytes up to a multiple of four.
When to use this tool
Use SCTP Chunk Length Padding Count when you need a field-level byte count or boundary check.
How to use the tool and how it works
- Enter length. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read padding, paddedLength. Use the output convention below.
Round a chunk length of 4-65535 bytes up to a multiple of four. Return padding in 0-3 bytes and paddedLength.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length | Required. Safe integer; minimum 4; maximum 65535. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| padding | Unused or added positions under the stated alignment rule. | Required. Safe integer. |
| paddedLength | Padded Length | Required. Safe integer. |
json
{
"input": {
"length": 7
},
"output": {
"padding": 1,
"paddedLength": 8
}
} Limitations and assumptions
- The supplied length includes the chunk header; the rounded storage length can exceed the 16-bit length field maximum.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Compare the computed span with the actual captured buffer and validate its contents separately.
References
Similar or alternative tools
- IPv4 Options Padding Boundary Byte Count
Pad optionBytes in 0-40 to a four-byte boundary.
- Ethernet Fcs Excluded Frame Length
Add or subtract the four-byte FCS according to includesFcs and return both length conventions.