Function uclcli::compress[][src]

pub fn compress(src: &[u8]) -> Result<Vec<u8>, UclErrorKind>
Expand description

NRV compress a buffer into a newly allocated buffer.

Panics

If ucl_init was not called prior to calling this function, this function will panic.

let src = [0; 1024];

assert_eq!(uclcli::compress(&src).unwrap(), b"\x92\x00\xaa\xa1\x00\x00\x00\x00\x00\x04\x80\xff");