Crate scale_compressed

Source
Expand description

Crate to compress SCALE encoded data.

This crate is useful for compressing data that is sent over the network.

§Example

use scale_compressed::ScaleCompressed;
use parity_scale_codec::{Encode, Decode};

let compressed = ScaleCompressed::new(vec![1u8, 2, 3, 4, 5]);
let encoded = compressed.encode();
let decoded = ScaleCompressed::<Vec<u8>>::decode(&mut &encoded[..]).unwrap();
assert_eq!(vec![1, 2, 3, 4, 5], decoded.0);

Structs§

ScaleCompressed
Wrap a struct to be compressed for encoding.