Description
Zigzag encoding of integers into unsigned integers.
Description
Zigzag encoding is usually a precursor to a varint encoding such as LEB128. It has the advantage that numbers nearer zero are represented with only the lower-order bits set.
README.md
zigzag
Zig-Zag encoding of integers into natural numbers. This encoding scheme has the advantage that LEB128, which is normally only specified for unsigned integers, will naturally represent small-magnitude signed integers (positive or negative) in few bytes.