cdrle 0.1.0

Calldata RLE: simple, bounded run-length encoding for Ethereum calldata.
Documentation
  • Coverage
  • 55.56%
    5 out of 9 items documented0 out of 3 items with examples
  • Size
  • Source code size: 7.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 341.5 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 7s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Vectorized/cdrle
    4 1 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Vectorized

cdrle

Calldata RLE — a simple, bounded run-length encoding specialized for Ethereum calldata.

  • Literals: any byte != 0x00
  • Runs: (0x00, CONTROL) where bit7=0→zeros, bit7=1→0xFF, low7=(len-1)
  • Caps: zeros 1..=128, 0xFF 1..=32
  • Encoder XOR-negates the first 4 bytes of the compressed stream to aid fallback routing; decoder un-negates on read.

Usage

let input = b"\x00\x00\x00\x00*\xff\xff\xff\x01\x02\x03\x00\xff\x00\xaa\xbb\x00\xff";
let compressed = cdrle::compress(input);
let decompressed = cdrle::decompress(&compressed).unwrap();
assert_eq!(input, &decompressed[..]);