sint32sint64
Sint32 and sint64 are signed integer types used in Protocol Buffers (protobuf) with a specific encoding designed to optimize space for values with small magnitude. The pair—often discussed together as sint32 and sint64—serves as the signed counterparts to the unsigned and fixed-width integer types in protobuf, but they employ a different encoding approach to reduce the size of negative numbers that are near zero.
Both types use zigzag encoding before applying varint encoding. Zigzag encoding converts the signed integer to
The practical effect is that sint32 and sint64 typically compress better than the standard signed int32 and
Ranges for the value domain align with their bit width: sint32 covers -2,147,483,648 to 2,147,483,647, and sint64