Crates.io | gdeflate |
lib.rs | gdeflate |
version | 0.4.1 |
source | src |
created_at | 2023-08-04 23:35:54.138237 |
updated_at | 2024-07-07 13:46:58.157978 |
description | A library for compressing and decompressing the GDeflate format |
homepage | https://github.com/projectkml/gdeflate-rs |
repository | https://github.com/projectkml/gdeflate-rs |
max_upload_size | |
id | 935741 |
size | 10,453 |
[dependencies]
gdeflate = "0.3.0"
Use the compress
and decompress
functions to compress and decompress data.
use gdeflate::{CompressionLevel, Compressor, Decompressor};
let uncompressed_data = vec![0, 1, 2]; // your input data
let mut compressor = Compressor::new(CompressionLevel::Level12).unwrap();
let result = compressor.compress(&uncompressed_data, 65536).unwrap();
let mut decompressor = Decompressor::new().unwrap();
let reconstructed_data = decompressor.decompress(&result).unwrap();
assert_eq!(&uncompressed_data, &reconstructed_data);
This library is still experimental and only supports single-threaded compression and decompression at the moment.