Code Monkey home page Code Monkey logo

miniz_oxide's Introduction

Main library Crates.ioDocs

C API Crates.ioDocs

miniz_oxide

Pure rust replacement for the miniz deflate/zlib encoder/decoder using no unsafe code. Builds in no_std mode, though requires the use of alloc and collections crates.

This project is organized into a C API shell and a rust crate. The Rust crate is found in the miniz_oxide subdirectory.

miniz_oxide 0.7.x requires at least Rust 1.50.0 Older versions 0.5.x and 0.6.x require at least rust 1.40.0, 0.3.x requires at least rust 0.36.0.

For a friendlier streaming API using readers and writers, flate2 can be used, which can use miniz_oxide as a rust-only back-end.

miniz_oxide_C_API

The C API is intended to replicate the API exported from miniz, and in turn also part of zlib. The C header is generated using cbindgen. The current implementation has not seen a lot of testing outside of automated tests, is a bit weak in documentation and should be seen as experimental.

The data structures do not share the exact same layout that is specified in miniz.h (from the original miniz), and should thus be allocated via the included functions.

API documentation

TODO

Testing

$ cargo test
$ ./test.sh

Benches

$ cargo bench --features=benching

or to compare to miniz

$ ./travis-after-success.sh

Including in C/C++ projects

Link against the libminiz_oxide_c_api.a generated by build.sh. The generated header that can be used is miniz.h (using the original miniz headers may or may not work), which currently also uses miniz_extra_defs.h for some static definitions.

Cargo-fuzz testing

Install fuzzer:

$ cargo install cargo-fuzz

Run fuzzer:

$ ./run_fuzz.sh

License

This library (excluding the miniz C code used for tests) is licensed under the MIT license. The library is based on the miniz C library, of which the parts used are dual-licensed under the MIT license and also the unlicense. The parts of miniz that are not covered by the unlicense is some Zip64 code which is only MIT licensed. This and other Zip functionality in miniz is not part of the miniz_oxidde and miniz_oxide_c_api rust libraries.

miniz_oxide's People

Contributors

frommi avatar oyvindln avatar shnatsel avatar connorskees avatar golddranks avatar ctjhoa avatar striezel avatar doumanash avatar ignatenkobrain avatar kornelski avatar lokathor avatar michaelmcdonnell avatar wehlutyk avatar matklad avatar alexcrichton avatar eminence avatar eventualbuddha avatar fauxfaux avatar dholbert avatar d-e-s-o avatar fhanau avatar heroickatora avatar xanewok avatar rreverser avatar jarede-dev avatar jasonish avatar jrmuizel avatar jonas-schievink avatar lollipopft avatar hellow554 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.