7 releases

0.1.6 Aug 23, 2020
0.1.5 Aug 20, 2020

#325 in Compression

Download history 7/week @ 2023-10-20 13/week @ 2023-10-27 10/week @ 2023-11-03 12/week @ 2023-11-10 7/week @ 2023-11-17 33/week @ 2023-11-24 27/week @ 2023-12-01 10/week @ 2023-12-08 11/week @ 2023-12-15 18/week @ 2023-12-22 2/week @ 2023-12-29 11/week @ 2024-01-05 5/week @ 2024-01-12 18/week @ 2024-01-19 18/week @ 2024-01-26 16/week @ 2024-02-02

57 downloads per month
Used in devpng

MIT license

40KB
937 lines

DevKER

devker Documentation License: MIT

Exemple

  • Easy to use.
use devker::prelude::{deflate, inflate, BlockType, Cache};

let mut cache = Cache::new();
let v = String::from("Hello world, this is a wonderful world !");
let v_in = v.into_bytes();

// Encode.
let encoded = deflate(&v_in, BlockType::Fixed, &mut cache);
// Decode.
let decoded = inflate(&encoded, &mut cache).unwrap();
assert_eq!(v_in, decoded);
  • Reusable cache.
use devker::prelude::{deflate, inflate, BlockType, Cache};

let mut cache = Cache::new();

// First try.

let v = String::from("Hello world, this is a wonderful world !");
let v_in = v.into_bytes();

let encoded = deflate(&v_in, BlockType::Fixed, &mut cache);
let decoded = inflate(&encoded, &mut cache).unwrap();
assert_eq!(v_in, decoded);

// Another try.

let v = String::from("The cache can be reused !");
let v_in = v.into_bytes();

let encoded = deflate(&v_in, BlockType::Fixed, &mut cache);
let decoded = inflate(&encoded, &mut cache).unwrap();
assert_eq!(v_in, decoded);

Support

  • Deflate/Inflate (Only fixed is supported for deflate)
  • Zlib (Dictionaries isn't supported)

Note

For the moment, this crate is inspired by libflate.

Documentation

See RustDoc Documentation.

Installation

Add following lines to your Cargo.toml:

[dependencies]
devker = "0"

Goal

In the future, this crate gathers most of the algorithms that I use for my projects.

The goal is to have performance and no dependency, in order to fully control the source code.

References

No runtime deps