Function blc::binary_encoding::compress [] [src]

pub fn compress(binary: &[u8]) -> Vec<u8>

Convert a stream of "bits" into bytes. It is not always reversible with decompress, because it produces full bytes, while the length of its input can be indivisible by 8.

Example

use blc::binary_encoding::{compress};

let succ_compressed = compress(&*b"000000011100101111011010");
assert_eq!(succ_compressed, vec![0x1, 0xCB, 0xDA]);