zlib-header

Crates.iozlib-header
lib.rszlib-header
version0.1.2
created_at2025-03-07 20:54:47.140815+00
updated_at2025-03-09 10:36:31.284361+00
descriptionLibrary to work with the 2 Byte zlib header, as defined in RFC 1950.
homepage
repositoryhttps://git.drfrugal.xyz/lib/zlib-header/
max_upload_size
id1583641
size14,379
(DrFrugalOfficial)

documentation

README

zlib-header

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
Commit count: 0

cargo fmt