Skip to main content

encode_zigzag

Function encode_zigzag 

Source
pub fn encode_zigzag(value: i64) -> u64
Expand description

Zigzag-encode a signed integer to an unsigned integer.

Maps small negative values to small positive integers: 0 → 0, -1 → 1, 1 → 2, -2 → 3, 2 → 4, …