[][src]Function streamvbyte::encode_delta

pub fn encode_delta(input: &[u32], intial: u32) -> Vec<u8>

Encode a sequence non decreasing of u32 integers into a vbyte encoded byte representation. Internally a buffer of length max_compressedbytes is allocated to store the compressed result.

The buffer will be truncated to the correct length before returning.

Arguments

  • input - The input sequence of non decreasing u32 integers
  • initial - The intial value to substract from the all the value in the array to decrease the universe. MUST be <= input[0]

Examples

use streamvbyte::encode_delta;
let out_bytes: Vec<u8> = encode_delta(&[1,2,44,5123,43,534],1);

Return

Returns the encoded output as a byte buffer