pub fn zigzag(val: i64) -> u64
convert a signed integer to an unsigned integer using zigzag encoding.