INTEGER and LENGTH Fields
Integer and Length fields are big endian binary encodings of numeric values. The byteLength attribute in a template field definition can act as a modifier to restrict the number of bytes used to encode the integer value. Unsigned integers are encoded as zero or positive-only values. The top-most bit is part of the magnitude of the value. Signed integers are encoded as two’s-complement binary values with the top-most bit as the sign bit. Length fields are unsigned integer values used to indicate the length of a Sequence field.
The table below shows the types of integer or length fields.
| Integer Field Type | Byte Length | Encoding | Example |
|---|---|---|---|
| uInt32 | 1 | 8 bit unsigned integer | <uInt32 name="MDPriceLevel" id="1023" byteLength="1"/> |
| uInt32 | 4 or omitted | 32 bit unsigned integer | <uInt32 name="MDEntrySize" id="271" byteLength="4"/> |
| uInt64 | 8 or omitted | 64 bit unsigned integer | <uInt64 name="SendingTime" id="52"/> |
| int32 | 1 | 8 bit signed integer | <int32 name="MDPriceLevel" id="1023" byteLength="1"/> |
| int32 | 4 or omitted | 32 bit signed integer | <int32 name="MDEntrySize" id="271"/> |
| int64 | 8 or omitted | 64 bit signed integer | <int64 name="SendingTime" id="52" byteLength="8"> |
| length | 1 | 8 bit unsigned integer | <length name="NoMDEntries" id="268" byteLength="1"/> |
The table below shows the minimum and maximum values for different integer data types.
| Type | Min | Max |
|---|---|---|
| uInt32 with byteLength="1" | 0 | 255 |
| uInt32 | 0 | 4,294,967,295 |
| uInt64 | 0 | 18,446,744,073,709,551,615 |
| int32 with byteLength="1" | -128 | 127 |
| int32 | -2,147,483,648 | 2,147,483,647 |
| int64 | - 9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
| length with byteLength="1" | 0 | 255 |





