Skip to main content
1

64-bit

tag = (field_number << 3) | 1. Followed by exactly 8 bytes little-endian.

Wire type 1 (64-bit) encodes exactly 8 bytes in little-endian order. Used for fixed64, sfixed64, and double fields. When you know values will always require 64 bits, wire type 1 is more efficient than a large varint which would also use 8-9 bytes but with encoding overhead.

Used For

fixed64sfixed64double

Encoding Details

Wire type 1 always reads exactly 8 bytes following the tag. The bytes are in little-endian order (least significant byte first), matching x86/x64 native byte order.

Field types using wire type 1: fixed64: unsigned 64-bit integer, always 8 bytes, faster than uint64 for values > 2^56 sfixed64: signed 64-bit integer, always 8 bytes, two's complement double: IEEE 754 double-precision floating-point, 8 bytes

Tag for wire type 1: tag = (field_number << 3) | 1 Field 1 with wire type 1: 0x09

Examples

LabelHexExplanation
double 1.0, field 109 00 00 00 00 00 00 f0 3fTag 0x09 = field 1, wire 1. Value: IEEE 754 double 1.0 = 0x3FF0000000000000 little-endian.
fixed64 256, field 109 00 01 00 00 00 00 00 00Tag 0x09. Value 256 = 0x0000000000000100 little-endian.

See Also