endianness
The order in which the bytes of a multi-byte number are stored: most significant first (big-endian) or least significant first (little-endian).
In more detail
Network protocols conventionally use big-endian, also called network byte order. Reading bytes with the wrong endianness gives a completely different number.
Examples
The Confluent wire format stores the schema ID as a big-endian four-byte integer.Windows and x86 processors are little-endian, so the number 0x5A4D appears in a file as the bytes 4D 5A (MZ).Related terms
- struct module — The Python standard library module that packs values into bytes, and unpacks them, according to a format string.
- Confluent wire format — The framing that schema-registry serializers put in front of each record: a zero magic byte, then a four-byte big-endian schema ID, then the encoded data.
- DataView — A JavaScript object for reading and writing numbers of different sizes at any position in an ArrayBuffer, with the byte order chosen on every call.
- TypedArray — An array-like view, such as Uint8Array, that reads and writes numbers of one fixed type in an ArrayBuffer.
- binary protocol — A network or file format that encodes messages as raw bytes at fixed positions instead of readable text.
- MZ header — The first bytes of every Windows executable, starting with the letters MZ, which point to the main PE header further in.
- UTF-16 — A Unicode encoding that stores each character as one or two 16-bit code units, used in memory by Java and JavaScript strings and by Windows.
Taught in
- The Field The Registry Refused — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Bytes On The Wire: JSON, Avro And Protobuf — Apache Kafka & Event Streaming
- The Schema Registry — Apache Kafka & Event Streaming
- Binary Data Manipulation: TypedArrays & Endianness — Node.js Internals & Backend Services
- Transform Streams: Custom Packet Decoding & Codecs — Node.js Internals & Backend Services
- YARA Rule Authoring & File Signature Matching — Security Operations & Threat Hunting (SOC)