3 releases
new 0.1.2 | Jan 22, 2025 |
---|---|
0.1.1 | Jan 22, 2025 |
0.1.0 | Jan 22, 2025 |
#98 in Magic Beans
Used in polkadot-du
5KB
56 lines
scale-compressed
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);
License: GPL-3.0 OR Apache-2.0
lib.rs
:
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);
Dependencies
~0.6–1.1MB
~25K SLoC