Universal.Common.IO.Compression 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Universal.Common.IO.Compression --version 1.0.0
                    
NuGet\Install-Package Universal.Common.IO.Compression -Version 1.0.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="Universal.Common.IO.Compression" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Universal.Common.IO.Compression" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Universal.Common.IO.Compression" />
                    
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 Universal.Common.IO.Compression --version 1.0.0
                    
#r "nuget: Universal.Common.IO.Compression, 1.0.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 Universal.Common.IO.Compression@1.0.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=Universal.Common.IO.Compression&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Universal.Common.IO.Compression&version=1.0.0
                    
Install as a Cake Tool

Universal.Common.IO.Compression

Class library for compression codecs not covered by System.IO.Compression: LZ4, LZMA (classic and Unity-header variants), and Zstandard. All from scratch, with no third-party package dependencies.

Each algorithm implements ICompressionAlgorithm (self-describing formats - Compress/Decompress need nothing but the data itself) or ISizedCompressionAlgorithm (raw LZ4 block format, whose decoder needs the original uncompressed size supplied separately, since the format carries no length or end marker of its own).

Quickstart

// LZ4 (ISizedCompressionAlgorithm - raw block format needs the original size to decompress)
Lz4CompressionAlgorithm lz4 = new Lz4CompressionAlgorithm();
byte[] compressed = lz4.Compress(data);
byte[] restored = lz4.Decompress(compressed, data.Length);

// LZMA, Zstandard, Deflate, Gzip (ICompressionAlgorithm - self-describing)
LzmaCompressionAlgorithm lzma = new LzmaCompressionAlgorithm();
byte[] compressed = lzma.Compress(data);
byte[] restored = lzma.Decompress(compressed);

ZstdCompressionAlgorithm zstd = new ZstdCompressionAlgorithm();
byte[] restored2 = zstd.Decompress(zstdCompressedBytes); // full decoder: raw/RLE/Huffman/FSE blocks alike

Status

  • LZ4, LZMA (+ Unity's own header variant): full encode and decode, verified byte-for-byte in both directions against independent real-world implementations (lz4js, Python's lzma module).
  • Zstandard: full decoder (frame/block parsing, FSE with predefined or custom tables, Huffman-coded literals, sequence execution) - verified against real Zstandard-compressed data, including actual Figma-exported .fig files. The encoder currently emits valid, standards-compliant frames using Raw/RLE blocks only (real data any conforming decoder reads correctly, just not entropy-coded) - full FSE/Huffman encoding is its own follow-up.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Universal.Common.IO.Compression:

Package Downloads
Universal.Common.Formats.Fig

Reads and writes Figma .fig file containers and their Kiwi-encoded document data.

Universal.Meta.WhatsApp.Client

WebSocket client for the WhatsApp multi-device protocol.

Universal.Git

A Git-compatible repository implementation built on Universal.VersionControl.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 63 9/8/2026
1.1.0 455 8/19/2026
1.0.0 296 8/14/2026

Initial release. LZ4 and LZMA (+ Unity's own LZMA header variant): full
encode/decode, verified byte-for-byte in both directions against independent reference implementations
(lz4js, Python's lzma module). Zstandard: full decoder (frame/block parsing, FSE with predefined or
custom tables, Huffman-coded literals, sequence execution), verified against real Zstandard-compressed
data including actual Figma-exported .fig files; the encoder currently emits valid standards-compliant
frames using Raw/RLE blocks only (correct, just not entropy-coded) - full FSE/Huffman encoding is a
follow-up. Also includes thin wrappers around System.IO.Compression's own Deflate/Gzip.