munzip

Crates.iomunzip
lib.rsmunzip
version0.1.2
sourcesrc
created_at2024-06-07 20:35:54.621812
updated_at2024-06-18 03:47:15.228212
descriptionminimal deflate-only unzip library
homepagehttps://github.com/computermouth/niveluno/tree/master/munzip
repositoryhttps://github.com/computermouth/niveluno
max_upload_size
id1265157
size18,951
Ben Young (computermouth)

documentation

README

mμnzip

mμnzip is a port of JUnzip to Rust.

mμnzip exclusively supports STORE and DEFLATE. Support for ZLIB was intentionally omitted.

features

iterable

let zi = munzip::IterableArchive::new(&mut input).unwrap();

for entry in zi {
    let mut entry = entry.unwrap();
    let filename = entry.filename();
    let buffer = entry.buffer().unwrap();
    write::write_file(&filename, &buffer).unwrap();
}

searchable

let mut zi = munzip::SearchableArchive::new(&mut input).unwrap();

let filename = "munzip/Cargo.toml";
let cargo_toml = zi.by_name(filename).unwrap().unwrap();
write::write_file(&"Cargo.toml".to_owned(), &cargo_toml).unwrap();

why?

  • To be small.
  • To have a simple unzip library with minimal (2)(inflate,adler32) dependencies.
  • For fun and practice.

stats

Method Dependencies Size Speed
mμnzip 2 419K 0.327s
zip 27 491K 0.158s
unzip 2 2.1M 0.286s

CONCLUSIONS:

  • is it very fast? no
  • is it very small? no
  • very featureful? no

😐👍

NOTES:

  • 'zip' refers to the zip crate
  • 'zip' was set to default-features = false, features = ["deflate"]
  • 'unzip' refers to debian's unzip package
  • 'unzip' size includes libc and libbz2
  • all binaries are stripped
  • Speed was measured by unzipping an archive of this entire repository on my laptop, so.
Commit count: 60

cargo fmt