// Map signed integers to their unsigned ZigZag representation for compact varints. Inputs must fit in signed 32 bits. pub fn zigzag_encode(value: i64) -> i64 { if value<0 { return -2*value-1; } value*2 }