Module osm.wire.zigzag

Protobuf ZigZag integer transforms.

ZigZag maps signed integers to unsigned integers so that values with small absolute magnitude retain short varint encodings. All operations are pure, allocation-free, and defined over the full 32- and 64-bit input domains.

Date

2026-09-12

Functions

NameDescription
decodeZigZag32(value) Decode a protobuf sint32 payload after varint decoding.
decodeZigZag64(value) Decode a protobuf sint64 payload after varint decoding.
encodeZigZag32(value) Encode a signed 32-bit value using the protobuf ZigZag transform.
encodeZigZag64(value) Encode a signed 64-bit value using the protobuf ZigZag transform.