Expand description
Holds helpers for encoding and decoding numbers using the zigzag encoding.
The zigzag encoding converts signed integers to unsigned integers and vice versa.
- Positive signed integers are multiplied by
2. - Negative signed integers are multiplied by
-2and1is subtracted. - The final result is then converted to an unsigned integer.
Functionsยง
- zigzag_
decode32 - Decodes a 32-bit unsigned integer to a 32-bit signed integer using the zigzag encoding.
- zigzag_
decode64 - Decodes a 64-bit unsigned integer to a 64-bit signed integer using the zigzag encoding.
- zigzag_
decode128 - Decodes a 128-bit unsigned integer to a 128-bit signed integer using the zigzag encoding.
- zigzag_
encode32 - Encodes a 32-bit signed integer to a 32-bit unsigned integer using the zigzag encoding.
- zigzag_
encode64 - Encodes a 64-bit signed integer to a 64-bit unsigned integer using the zigzag encoding.
- zigzag_
encode128 - Encodes a 128-bit signed integer to a 128-bit unsigned integer using the zigzag encoding.