Function varint_simd::encode_zigzag

source ·
pub fn encode_zigzag<T: SignedVarIntTarget>(num: T) -> ([u8; 16], u8)
Available with target feature sse2 only.
Expand description

Convenience function for encoding a single signed integer in ZigZag format to a varint. See also: encode

Examples

use varint_simd::encode_zigzag;

let encoded = encode_zigzag::<i32>(-20);
assert_eq!(encoded, ([39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1));