GithubHelp home page GithubHelp logo

p4nda / ironsnappy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skyyearxp/ironsnappy

0.0 0.0 0.0 441 KB

๐Ÿ’พ .NET Managed port of Google Snappy

License: Apache License 2.0

C# 100.00%

ironsnappy's Introduction

IronSnappy

This is a native .NET port of Google Snappy compression/decompression library. The only implementation that is stable, fast, up to date with latest Snappy improvements, and most importantly does not depend on native Snappy binaries. Works on Windows, Linux, MacOSX, ARM and so on.

It is originally ported from the Golang implementation because Go is much easier to understand and work with comparing to C++.

The library passes golden tests from the original implementation i.e. compares that compression/decompression is fully compatible with the original implementation.

Internally, it is using array pooling and spans for efficient memory allocation and low GC pressure.

Using

Reference the following NuGet package Nuget. You are ready to go.

To compress a buffer:

using IronSnappy;

byte[] input = File.ReadAllBytes("TestData/Mark.Twain-Tom.Sawyer.txt");
byte[] compressed = Snappy.Encode(input);

To decompress a buffer:

using IronSnappy;

byte[] input = File.ReadAllBytes("TestData/Mark.Twain-Tom.Sawyer.rawsnappy.txt")
byte[] uncompressed = Snappy.Decode(input);

Streaming Format

Streams are fully supported. To decompress use Snappy.OpenReader(Stream) and to compress Snappy.OpenWriter(Stream). Don't forget to flush ๐Ÿšฝ and dispose ๐Ÿงป!

Contributing

Contributions are more than welcome, just raise an issue and fire a PR. The code might have a few ugly bits due to the fact it was ported as is from Golang, you are welcome to make it prettier and/or faster.

ironsnappy's People

Contributors

aloneguid avatar jtone123 avatar rodo-r2r avatar skyyearxp avatar xqrzd 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.