liveBook · Manning

Little-endian

As explained in JavaScript in Depth

A byte order that stores the least significant byte first.

Why might the bytes for 34,375 appear as 0x47 0x86 rather than 0x86 0x47? The number’s 16-bit representation divides into two bytes: 0x86 is the most significant, and 0x47 is the least significant. Little-endian byte order stores the least significant byte first. The order of the bytes changes, not the value they represent. section 3.1.1

Big-endian stores the same bytes as 0x86 0x47, with the most significant byte first. Most modern systems store numbers little-endian internally but convert to big-endian for network transmission. When inspecting multi-byte data, check which byte order applies before interpreting the value. section 3.1.1

How JavaScript in Depth covers it

How deep it goes
Defines little-endian through a worked two-byte conversion, without detailing a particular runtime’s implementation.
Examples
Uses 34,375 to contrast the byte sequences 0x47 0x86 and 0x86 0x47.
What it assumes
Assumes basic binary and hexadecimal notation while explaining byte significance with a 16-bit number.
What you can do after
Evaluate/understand multi-byte sequences by identifying which byte is least significant and which order is in use.
How it connects
Contrasts little-endian with big-endian network order and relates both to significant bytes and binary representation.

Also explained in

Compare how 3 books explain little-endian →

Related concepts

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