zlib-header 0.1.0

Library to work with the 2 Byte zlib header, as defined in RFC 1950.
Documentation
  • Coverage
  • 88%
    22 out of 25 items documented1 out of 20 items with examples
  • Size
  • Source code size: 12.87 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 711.74 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DrFrugalOfficial
zlib-header-0.1.0 has been yanked.

Library to work with the 2 Byte zlib header, as defined in RFC 1950.

Examples

use zlib_header::ZlibHeader;
let cm = 8;
let cinfo = 7;
let fdict = false;
let flevel = 2;
let header = ZlibHeader::new(cm, cinfo, fdict, flevel);
match header {
  Ok(header) => {
    println!("header is valid (strict): {}", header.is_valid_strict()); // header is valid (strict): true 
  },
  Err(err) => eprintln!("Unable to initialize zlib header: {:?}", err)
}
use zlib_header::ZlibHeader;
let header = ZlibHeader::default();
println!("Display: {}", header); // Display: 789C
println!("Debug: {:?}", header); // Debug: ZlibHeader { DEFLATE | 32768 Bytes | default | Dictionary: false | valid }
let bytes = [0x78, 0x9C];
println!("header matches expected bytes: {}", header == bytes); // header matches expected bytes: true