compiling the zip2 crate to wasm with the goal of compiling to luau through wasynth
Find a file
2024-04-19 18:50:27 -07:00
.github Merge branch 'master' into dependabot/github_actions/github/codeql-action-3 2024-04-18 20:26:43 -07:00
benches Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
examples Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
fuzz Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
security-advisories in-source vulnerability tracking 2023-09-19 18:55:01 +01:00
src Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
tests Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
.gitignore Ignore .DS_Store files 2024-04-17 19:19:54 -07:00
.whitesource Add .whitesource configuration file 2023-04-23 21:33:22 +00:00
Cargo.toml Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
CHANGELOG.md Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00
CODE_OF_CONDUCT.md doc: veeeery small fix to CoC 2022-01-23 17:35:39 +03:00
CONTRIBUTING.md Create CONTRIBUTING.md 2024-04-15 13:08:24 -07:00
LICENSE Added Travis support, README and LICENSE 2014-09-11 10:50:41 +02:00
README.md Change crate name to "zip" per https://github.com/zip-rs/zip/issues/446#issuecomment-2063837388 2024-04-19 18:50:27 -07:00

zip

Build Status Crates.io version

Documentation

Info

A zip library for rust which supports reading and writing of simple ZIP files. Forked from https://crates.io/crates/zip to add more features and improve test coverage.

Supported compression formats:

  • stored (i.e. none)
  • deflate
  • deflate64 (decompression only)
  • bzip2
  • zstd

Currently unsupported zip extensions:

  • Encryption
  • Multi-disk

Usage

With all default features:

[dependencies]
zip = "1.1.0"

Without the default features:

[dependencies]
zip = { version = "1.1.0", default-features = false }

The features available are:

  • aes-crypto: Enables decryption of files which were encrypted with AES. Supports AE-1 and AE-2 methods.
  • deflate: Enables decompressing the deflate compression algorithm, which is the default for zip files.
  • deflate-miniz: Enables deflating files with the miniz_oxide library (used when compression quality is 0..=9).
  • deflate-zlib: Enables deflating files with the zlib library (used when compression quality is 0..=9).
  • deflate-zlib-ng: Enables deflating files with the zlib-ng library (used when compression quality is 0..=9). This is the fastest deflate implementation available.
  • deflate-zopfli: Enables deflating files with the zopfli library (used when compression quality is 10..=264). This is the most effective deflate implementation available.
  • deflate64: Enables the deflate64 compression algorithm. Decompression is only supported.
  • bzip2: Enables the BZip2 compression algorithm.
  • time: Enables features using the time crate.
  • chrono: Enables converting last-modified zip::DateTime to and from chrono::NaiveDateTime.
  • zstd: Enables the Zstandard compression algorithm.

By default aes-crypto, deflate, deflate-zlib-ng, deflate-zopfli, bzip2, time and zstd are enabled.

MSRV

Our current Minimum Supported Rust Version is 1.70. When adding features, we will follow these guidelines:

  • We will always support the latest four minor Rust versions. This gives you a 6 month window to upgrade your compiler.
  • Any change to the MSRV will be accompanied with a minor version bump
    • While the crate is pre-1.0, this will be a change to the PATCH version.

Examples

See the examples directory for:

  • How to write a file to a zip.
  • How to write a directory of files to a zip (using walkdir).
  • How to extract a zip file.
  • How to extract a single file from a zip.
  • How to read a zip from the standard input.

Fuzzing

Fuzzing support is through cargo fuzz. To install cargo fuzz:

cargo install cargo-fuzz

To list fuzz targets:

cargo +nightly fuzz list

To start fuzzing zip extraction:

cargo +nightly fuzz run fuzz_read

To start fuzzing zip creation:

cargo +nightly fuzz run fuzz_write