VOOZH about

URL: https://www.nuget.org/packages/IronCompress/

⇱ NuGet Gallery | IronCompress 1.7.0


ο»Ώ

πŸ‘ Image
IronCompress 1.7.0

dotnet add package IronCompress --version 1.7.0
 
 
NuGet\Install-Package IronCompress -Version 1.7.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IronCompress" Version="1.7.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IronCompress" Version="1.7.0" />
 
Directory.Packages.props
<PackageReference Include="IronCompress" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IronCompress --version 1.7.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IronCompress, 1.7.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IronCompress@1.7.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IronCompress&version=1.7.0
 
Install as a Cake Addin
#tool nuget:?package=IronCompress&version=1.7.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

IronCompress

πŸ‘ NuGet

<img src="icon.png" width=80 height=80 align="left"/> C++ compression methods joined together in one native library, cross-compiled for multiple architectures and exposed as a .NET library. .NET has built-in support for Gzip and Brotli (which is what this library is using) but other compression methods are either available only as native libraries hard (impossible for some) to consume, or ill-ported C# alternatives. In fact, I myself wrote one of them. Using native, original implementations is the way to go if you want to keep performance, security, and features up to date.

The library supports the following formats:

And following architectures:

Format Managed Windows Linux Mac OSX ◀️ OS<br />Arch πŸ”½
Snappy βœ…<br /><sup>via Snappier </sup> β›” β›” β›” x32
βœ… βœ… β›” x64
β›” βœ… βœ… ARM64
Zstd βœ…<br /><sup>via ZstdSharp</sup> β›” β›” β›” x32
βœ… βœ… β›” x64
β›” βœ… βœ… ARM64
Gzip βœ…<br /><sup>part of .NET</sup> β›” β›” β›” x32
β›” β›” β›” x64
β›” β›” β›” ARM64
Brotli βœ…<br /><sup>except on .NET Standard 2.0</sup> β›” β›” β›” x32
βœ… βœ… β›” x64
β›” βœ… βœ… ARM64
LZO β›” β›” β›” β›” x32
βœ… βœ… β›” x64
β›” βœ… βœ… ARM64
LZ4 β›” β›” β›” β›” x32
βœ… βœ… β›” x64
β›” βœ… βœ… ARM64

I periodically update to the latest binaries. All the binaries are compiled from C/C++ source with CMake for major systems i.e. Linux, Windows and Mac OSX. They are then wrapped safely with a .NET interface.

Logic

Although managed versions are available, they will be only used as a fallback when native library is not available, because native libraries are faster and more up to date with latest advancements.

You can check which version was used by reading IronCompressResult.NativeUsed flag.

Using

This library only compresses buffers. It may work with streams in the future, but I am currently only interested in buffers. Essentially, you pass ReadOnlySpan<byte> as an input, and receive Span<T> as an output in the most efficient way.

Here is an example of how to compress buffer with snappy codec:

using IronCompress;	// root namespace

// Construct library entry point and optionally pass an implementation of ArrayPool.
// I will pass default shared pool here.
var iron = new Iron();

byte[] input = ...;
using(IronCompressResult compressed = iron.Compress(Codec.Snappy, input.AsSpan())) {
 // ... use data
}

Compressand Decompress methods actually return a Result class which wraps byte array of compression or decompression operation. You can access the underlying result by calling to .AsSpan() method inside the result. On dispose, Result makes sure the underlying memory is freed up - if pooling was used, it will be returned back to the pool.

To decompress:

using (IronCompressResult uncompressed = iron.Decompress(Codec.Snappy, compressed, input.Length)) {
	// ... use data
}

As with compression, this returns Result with decompressed data. It's worth nothing one important difference - decompression needs the length of output buffer specified as third parameter (input.Length). Although some decompressors can guess uncompressed length more or less correct, the others won't know it beforehand. In reality this problem is solved by using a framing format that adds metadata about resulting length, however many compression formats do not define that and consider compressed packets to be implementation specific.

You will need more or less recent C++ compiler, CMake and .NET SDK 8 to build the code.

Building

See for building instructions.

Hint: To develop managed only code locally you can download the latest artifact from Actions output and put it into native/ubin so you have binaries for all platforms.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 is compatible. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (43)

Showing the top 5 NuGet packages that depend on IronCompress:

Package Downloads
Elsa.Common

Provides services and utility functions common to Elsa modules. For example, it provides a system clock and a memory store implementation.

Elsa.Workflows.Management

Provides workflow management functionality.

Elsa.Dsl

Provides a custom DSL to write workflows with in a syntax similar to JavaScript but with native keywords translating to workflow functionality. For example if/else would translate to the If activity. Very cool, but also very experimental ;)

Elsa.JavaScript

Provides a JavaScript expression provider.

Elsa.EntityFrameworkCore

Provides Entity Framework Core implementations of various abstractions from various modules.

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on IronCompress:

Repository Stars
elsa-workflows/elsa-core
The Workflow Engine for .NET
mjebrahimi/EasyCompressor
⚑An Easy-to-Use and Optimized compression library for .NET that unified several compression algorithms including LZ4, Snappy, Zstd, LZMA, Brotli, GZip, ZLib, and Deflate. This library aids in Improving Performance by Reducing Memory Usage and Bandwidth Usage. Along with a greate Performance Benchmark between different compression algorithms.
ProteoWizard/pwiz
The ProteoWizard Library is a set of software libraries and tools for rapid development of mass spectrometry and proteomic data analysis software.
LittleBigRefresh/Refresh
A second-generation custom server for LittleBigPlanet that focuses on quality of life features and improving user experience.
Version Downloads Last Updated
1.7.0 729,902 11/13/2025
1.6.3 5,487,566 10/14/2024
1.6.2 148,492 9/30/2024
1.6.1 590 9/30/2024
1.6.1-pre.1 199 9/27/2024
1.6.0 755 9/24/2024
1.6.0-pre.1 179 9/24/2024
1.5.2 1,899,523 5/22/2024
1.5.2-pre.1 226 5/22/2024
1.5.1 3,477,359 8/3/2023
1.5.0 627 8/3/2023
1.4.0 614,192 5/10/2023
1.3.0 867,707 1/27/2023
1.2.8 739 1/26/2023
1.2.7 11,793 1/23/2023
1.2.6 20,351 1/11/2023
1.2.5 163,358 12/21/2022
1.2.4 44,940 11/24/2022
1.2.3 165,871 11/10/2022
1.2.2 781 11/10/2022
Loading failed