liveBook · Manning

Little-endian

As explained in Latency

A byte order that stores the least significant byte of a multi-byte value first and the most significant byte last.

Little-endian stores the least significant byte of a multi-byte value first and the most significant byte last. For a 32-bit value, this determines how consecutive memory bytes reconstruct the original number. section 7.3

Reading a 32-bit integer

The value 0xE011CFD0 appears in little-endian memory as 0xD0, 0xCF, 0x11, 0xE0. Likewise, order ID 1001 (0x000003E9) occupies bytes 0xE9, 0x03, 0x00, and 0x00. section 7.3

Byte order matters when serializing and deserializing data. CPU architecture determines in-memory order; little-endian is common on ARM and x86, while many network protocols default to big-endian. section 7.3

Figure 7.2 Serialization transforms the in-memory representation of data (shown on the left as a Rust struct) to a serialized format such as JSON (shown on the right). Deserialization performs the opposite transformation from a serialized format to an in-memory representation.
Figure 7.4: Serialization transforms in-memory representation to a serialized format such as JSON. Deserialization performs the opposite transformation from serialized format to in-memory representation.

Use the figure to compare a Rust struct's in-memory representation with its JSON serialization and the reverse deserialization path. section 7.3

How Latency covers it

How deep it goes
Defines byte ordering and works through 32-bit layouts, but stops short of implementation code or broader protocol details.
Examples
Uses 0xE011CFD0, order ID 1001, a Rust order struct, and JSON serialization as concrete examples.
What you can do after
Evaluate/understand how multi-byte values occupy memory and transform between in-memory and serialized formats.
How it connects
Connects byte order with serialization, deserialization, CPU architecture, Rust, JSON, and big-endian representation.

Also explained in

Compare how 2 books explain little-endian →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.