Code Monkey home page Code Monkey logo

deflate-rs's Introduction

deflate-rs

Build StatusCrates.ioDocs

An implementation of a DEFLATE encoder in pure rust. Not a direct port, but does take some inspiration from zlib, miniz and zopfli. The API is based on the one in the flate2 crate that contains bindings, zlib miniz_oxide, and miniz.

Deflate encoding with and without zlib and gzip metadata (zlib dictionaries are not supported) is supported. No unsafe code is used.

This library is now mostly in maintainance mode, focus being on the rust-backend of flate2 instead.

Usage:

Simple compression function:

use deflate::deflate_bytes;

let data = b"Some data";
let compressed = deflate_bytes(&data);

Using a writer:

use std::io::Write;

use deflate::Compression;
use deflate::write::ZlibEncoder;

let data = b"This is some test data";
let mut encoder = ZlibEncoder::new(Vec::new(), Compression::Default);
encoder.write_all(data).unwrap();
let compressed_data = encoder.finish().unwrap();

Other deflate/zlib rust projects from various people

  • flate2 FLATE, Gzip, and Zlib bindings for Rust - can use miniz_oxide for a full rust-implemented library.
  • Zopfli in Rust Rust port of zopfli
  • inflate DEFLATE decoder implemented in rust
  • miniz-oxide Port of miniz to rust.
  • libflate Another DEFLATE/Zlib/Gzip encoder and decoder written in Rust. (Only does some very light compression).

License

deflate is distributed under the terms of both the MIT and Apache 2.0 licences.

bitstream.rs is © @nwin and was released under both MIT and Apache 2.0

Some code in length_encode.rs has been ported from the miniz library, which is public domain.

The test data (src/pg11.txt) is borrowed from Project Gutenberg and is available under public domain, or the Project Gutenberg Licence

deflate-rs's People

Contributors

eclipseo avatar ferjm avatar ignatenkobrain avatar johntitor avatar mbrubeck avatar oyvindln avatar

Watchers

 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.