All Projects → mjebrahimi → EasyCompressor

mjebrahimi / EasyCompressor

Licence: MIT License
⚡ 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.

Programming Languages

C#
18002 projects
HTML
75241 projects

Projects that are alternatives of or similar to EasyCompressor

pyrus-cramjam
Thin Python wrapper to de/compression algorithms in Rust - lightweight & no dependencies
Stars: ✭ 40 (-76.05%)
Mutual labels:  compression, gzip, decompression, brotli, snappy, zstd, lz4, deflate
Compress
Optimized Go Compression Packages
Stars: ✭ 2,478 (+1383.83%)
Mutual labels:  compression, gzip, decompression, snappy, zstd, zstandard
Archiver
Easily create & extract archives, and compress & decompress files of various formats
Stars: ✭ 3,373 (+1919.76%)
Mutual labels:  gzip, brotli, snappy, lz4, zstandard
7 Zip Zstd
7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
Stars: ✭ 2,150 (+1187.43%)
Mutual labels:  brotli, zstd, lz4, lzma, zstandard
box
Box - Open Standard Archive Format, a zip killer.
Stars: ✭ 38 (-77.25%)
Mutual labels:  compression, brotli, snappy, deflate, zstandard
zstdmt
Multithreading Library for Brotli, Lizard, LZ4, LZ5, Snappy and Zstandard
Stars: ✭ 107 (-35.93%)
Mutual labels:  brotli, snappy, zstd, lz4, zstandard
Turbobench
Compression Benchmark
Stars: ✭ 211 (+26.35%)
Mutual labels:  compression, gzip, brotli, compressor, zstd
tiny
compress data for better performance
Stars: ✭ 21 (-87.43%)
Mutual labels:  compression, brotli, snappy, lz4
power-gzip
POWER9 gzip engine documentation and code samples
Stars: ✭ 16 (-90.42%)
Mutual labels:  compression, gzip, decompression, deflate
http compression
🗜️ Deno HTTP compression middleware
Stars: ✭ 34 (-79.64%)
Mutual labels:  compression, gzip, compress, deflate
ratarmount
Random Access Read-Only Tar Mount
Stars: ✭ 217 (+29.94%)
Mutual labels:  compression, gzip, zstd, zstandard
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 (+144.31%)
Mutual labels:  compression, brotli, compressor, zstd
Lzbench
lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors
Stars: ✭ 490 (+193.41%)
Mutual labels:  compression, brotli, compressor, zstd
Rust Brotli
Brotli compressor and decompressor written in rust that optionally avoids the stdlib
Stars: ✭ 504 (+201.8%)
Mutual labels:  compression, decompression, brotli, compressor
ZstdKit
An Objective-C and Swift library for Zstd (Zstandard) compression and decompression.
Stars: ✭ 22 (-86.83%)
Mutual labels:  compression, zstd, zstandard
lambdafs
Efficient (de)compression package for AWS Lambda
Stars: ✭ 24 (-85.63%)
Mutual labels:  gzip, decompression, brotli
gzipped
Replacement for golang http.FileServer which supports precompressed static assets.
Stars: ✭ 86 (-48.5%)
Mutual labels:  compression, gzip, brotli
deflate-rs
An implementation of a DEFLATE encoder in rust
Stars: ✭ 47 (-71.86%)
Mutual labels:  compression, gzip, deflate
restio
HTTP Client for Dart inspired by OkHttp
Stars: ✭ 46 (-72.46%)
Mutual labels:  gzip, brotli, deflate
zstd-rs
zstd-decoder in pure rust
Stars: ✭ 148 (-11.38%)
Mutual labels:  compression, decompression, zstd

NuGet Badge License: MIT Build Status

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.

Nuget Packages

Package Name Version Description
EasyCompressor Contains GZip, Deflate and (Brotli available only in .NETCore2.1, .NETStandard2.1 and above)
EasyCompressor.BrotliNET Contains Brotli using Brotli.NET (for erlier than .NETCore2.1, .NETStandard2.1)
EasyCompressor.LZ4 Contains LZ4 using K4os.Compression.LZ4
EasyCompressor.LZMA Contains LZMA using LZMA-SDK
EasyCompressor.Snappy Contains Snappy using Snappy.Standard
EasyCompressor.Zstd Contains Zstd (ZStandard) using ZstdNet
EasyCaching.Extensions.EasyCompressor This integrates EasyCaching with EasyCompressor. (How to use)

Note :

LZ4, GZip, Deflate, Brotli, and LZMA are cross-platform because these are complete implementations with C#. (also BrotliNet too because this is a wrapper of brotli native library for win/linux/osx)

Zstd and Snappy are not cross-platform, because they are just a wrapper of the native library for windows.

Features

  • Supports and implements many compression algorithms.
  • Supports async/await and CancellationToken.
  • Supports woking with multiple compressors with specified names
  • Supports Stream as most as possible (depending on the underlying library)
  • Compress/Decompress between byte[], Stream, StreamReader and StreamWriter.

Get Started

1. Install Package

PM> Install-Package EasyCompressor.LZ4

2. Add Services

public void ConfigureServices(IServiceCollection services)
{
    //...
    services.AddLZ4Compressor();

    //or services.AddGZipCompressor();      package : EasyCompressor
    //or services.AddDeflateCompressor();   package : EasyCompressor
    //or services.AddBrotliCompressor();    package : EasyCompressor
    //or services.AddBrotliNetCompressor(); package : EasyCompressor.BrotliNET
    //or services.AddZstdCompressor();      package : EasyCompressor.Zstd
    //or services.AddLZMACompressor();      package : EasyCompressor.LZMA
    //or services.AddSnappyCompressor();    package : EasyCompressor.Snappy
}

3. Use it

using EasyCompressor;

// Inject (ICompressor compressor)

// Compress
var compressedBytes = compressor.Compress(inputBytes);

// Decompress
var uncompressedBytes = compressor.Decompress(compressedBytes);

Benchmark

Tips and Results

Original data size is:

  • 89,535 bytes (about ≈ 90 KB) (binary serialized output of a json file by messagepack).

Compressed data size (for example):

  • 776 bytes for Zstd (115x compression ratio) that results in 99.13% memory and bandwidth saving.
  • 1,234 bytes for LZ4 (72x compression ratio) that results in 98.62% memory and bandwidth saving.

Maximum Compression:

  • Brotli
  • Zstd
  • LZMA
  • LZ4

Fastest Speed:

  • Zstd
  • Snappy
  • LZ4

Most Efficient:

  • Zstd (windows only package)
  • LZ4 (cross-platform package)

Moderated:

  • GZip
  • Deflate

Compression Ratio : higher is better Benchmark

Contributing

Create an issue if you find a BUG or have a Suggestion or Question. If you want to develop this project :

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Give a Star! ⭐️

If you find this repository useful, please give it a star. Thanks!

License

EasyCompressor is Copyright © 2020 Mohammd Javad Ebrahimi under the 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].