Description
Split the value into three base-256 octets; return most-significant first for big and reverse that order for little.
A fixed-width unsigned word has a bounded integer range and an explicit byte order. Reversing octet order changes representation while leaving the intended integer value unchanged.
Split the value into three base-256 octets; return most-significant first for big and reverse that order for little.
When to use this tool
Use Encoding: Pack Unsigned 24bit Word when packing one supplied unsigned word into its declared byte order.
How to use the tool and how it works
- Enter value, byteOrder. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Require whole value in [0,16777215] and byteOrder big or little. Split the value into three base-256 octets; return most-significant first for big and reverse that order for little.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| value | Value | Required. Safe integer. |
| byteOrder | Byte Order | Required. Text; one of "big", "little". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Object containing the named calculated members below. | Required. Object. |
| result.bytes | Bytes | Calculated result member: array. |
{
"input": {
"value": 1193046,
"byteOrder": "big"
},
"output": {
"result": {
"bytes": [
18,
52,
86
]
}
}
} Limitations and assumptions
- This packs one unsigned 24-bit word without framing, signed conversion or checksums. Byte order must match the consuming format.
- Outputs are nested inside result. 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
Use the surrounding binary format for signedness, framing, alignment and integrity checks.
References
Similar or alternative tools
- Protocol Buffers Fixed32 Octet Fields
Return four octets floor(value/256^i) modulo 256 for i = 0,1,2,3, in least-significant-byte-first order.
- Encoding: Packed BCD Byte Digits
Return byte = 16*tens+units, putting the decimal tens digit in the high nibble.