All Projects → gyscos → Zstd Rs

gyscos / Zstd Rs

Licence: mit
A rust binding for the zstd compression library.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Zstd Rs

ZRA
ZStandard Random Access (ZRA) allows random access inside an archive compressed using ZStandard
Stars: ✭ 21 (-86.79%)
Mutual labels:  compression, zstd
ratarmount
Random Access Read-Only Tar Mount
Stars: ✭ 217 (+36.48%)
Mutual labels:  compression, zstd
ZstdKit
An Objective-C and Swift library for Zstd (Zstandard) compression and decompression.
Stars: ✭ 22 (-86.16%)
Mutual labels:  compression, zstd
Compress
Optimized Go Compression Packages
Stars: ✭ 2,478 (+1458.49%)
Mutual labels:  compression, zstd
Gozstd
go wrapper for zstd
Stars: ✭ 275 (+72.96%)
Mutual labels:  zstd, compression
Turbobench
Compression Benchmark
Stars: ✭ 211 (+32.7%)
Mutual labels:  zstd, compression
upx
Node.js cross-platform wrapper for UPX - the ultimate packer for eXecutables.
Stars: ✭ 27 (-83.02%)
Mutual labels:  wrapper, compression
Zstdnet
Zstd wrapper for .NET
Stars: ✭ 176 (+10.69%)
Mutual labels:  zstd, compression
Python Blosc
A Python wrapper for the extremely fast Blosc compression library
Stars: ✭ 264 (+66.04%)
Mutual labels:  wrapper, compression
EasyCompressor
⚡ A compression library that implements many compression algorithms such as LZ4, Zstd, LZMA, Snappy, Brotli, GZip, and Deflate. It helps you to improve performance by reducing Memory Usage and Network Traffic for caching.
Stars: ✭ 167 (+5.03%)
Mutual labels:  compression, zstd
zstd-rs
zstd-decoder in pure rust
Stars: ✭ 148 (-6.92%)
Mutual labels:  compression, zstd
Dwarfs
A fast high compression read-only file system
Stars: ✭ 444 (+179.25%)
Mutual labels:  zstd, compression
pyrus-cramjam
Thin Python wrapper to de/compression algorithms in Rust - lightweight & no dependencies
Stars: ✭ 40 (-74.84%)
Mutual labels:  compression, zstd
Lizard
Lizard (formerly LZ5) is an efficient compressor with very fast decompression. It achieves compression ratio that is comparable to zip/zlib and zstd/brotli (at low and medium compression levels) at decompression speed of 1000 MB/s and faster.
Stars: ✭ 408 (+156.6%)
Mutual labels:  zstd, compression
Lzbench
lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors
Stars: ✭ 490 (+208.18%)
Mutual labels:  zstd, compression
Digital video introduction
A hands-on introduction to video technology: image, video, codec (av1, vp9, h265) and more (ffmpeg encoding).
Stars: ✭ 12,184 (+7562.89%)
Mutual labels:  compression
Py Kaldi Asr
Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.
Stars: ✭ 156 (-1.89%)
Mutual labels:  wrapper
Georaptor
Python Geohash Compression Tool
Stars: ✭ 143 (-10.06%)
Mutual labels:  compression
Shaderc Rs
Rust bindings for the shaderc library.
Stars: ✭ 143 (-10.06%)
Mutual labels:  rust-bindings
Pygm
🐍 Python library implementing sorted containers with state-of-the-art query performance and compressed memory usage
Stars: ✭ 156 (-1.89%)
Mutual labels:  compression

zstd

Build Status crates.io MIT licensed

This library is a rust binding for the zstd compression library.

Documentation

1 - Add to cargo.toml

Using cargo-edit

$ cargo add zstd

Manually

# Cargo.toml

[dependencies]
zstd = "0.5"

2 - Usage

This library provides Read and Write wrappers to handle (de)compression, along with convenience functions to made common tasks easier.

For instance, stream::copy_encode and stream::copy_decode are easy-to-use wrappers around std::io::copy. Check the stream example:

extern crate zstd;

use std::io;

// This function use the convenient `copy_encode` method
fn compress(level: i32) {
    zstd::stream::copy_encode(io::stdin(), io::stdout(), level).unwrap();
}

// This function does the same thing, directly using an `Encoder`:
fn compress_manually(level: i32) {
    let mut encoder = zstd::stream::Encoder::new(io::stdout(), level).unwrap();
    io::copy(&mut io::stdin(), &mut encoder).unwrap();
    encoder.finish().unwrap();
}

fn decompress() {
    zstd::stream::copy_decode(io::stdin(), io::stdout()).unwrap();
}

Asynchronous support

You can use this library to wrap non-blocking writer/readers: add the tokio feature, and stream::Encoder and stream::Decoder will implement AsyncWrite and AsyncRead, respectively.

Compile it yourself

zstd is included as a submodule. To get everything during your clone, use:

git clone https://github.com/gyscos/zstd-rs --recursive

Or, if you cloned it without the --recursive flag, call this from inside the repository:

git submodule update --init

Then, running cargo build should take care of building the C library and linking to it.

Build-time bindgen

This library includes a pre-generated bindings.rs file. You can also generate new bindings at build-time, using the bindgen feature:

cargo build --features bindgen

TODO

  • Benchmarks, optimizations, ...

Disclaimer

This implementation is largely inspired by bozaro's lz4-rs.

License

  • The zstd C library is under a dual BSD/GPLv2 license.
  • This zstd-rs binding library is under a MIT license.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].