Recursive AI
LibraryC#AvailablePreview

onearchive

Compression codecs and archive formats for .NET, in managed code with no native libraries. The compressed bytes are identical on every platform.

A preview, 0.7.0-preview.1. Each codec and the archive layer stay marked experimental until they meet their speed targets.

dotnet add package RecursiveAI.OneArchive --prerelease

A quick look

One call per codec, and one per archive. The format comes from the extension when you write and from the bytes when you read.

Getting started
Program.csC#
using RecursiveAI.OneArchive;
using RecursiveAI.OneCompress.Zstd;
byte[] packed = Zstd.Compress(data, new ZstdCompressionOptions { Level = 19 });
Archive.Create("backup.tar.zst").Add("assets/").Save();
Archive.Extract("upload.zip", "out");   // nothing lands outside "out"
What it does

What it does

Zstandard, fully

Frames, dictionaries and dictionary training, long-distance matching, multithreaded jobs and the seekable format.

Every common codec

LZ4, Deflate, zlib, gzip, Deflate64, LZMA, LZMA2, xz, lzip, bzip2, Brotli and PPMd, the LZX decoder, and CRC32, CRC32C, CRC64, Adler-32 and xxHash64.

Archives, read and written

tar, zip, 7z, cpio, ar, ISO 9660 with Joliet and Rock Ridge, and Microsoft compound files. cab and RAR 5 are read.

Safe extraction by default

No writes outside the target, no escaping links, and limits on size, expansion ratio, entry count and path length, each loosened only when you ask.

Encryption

WinZip AES for zip, read and written, and AES-256 for 7z, with encrypted headers.

Small binaries

An app that uses a few codecs can switch the rest off and trim them away, for a smaller NativeAOT or WebAssembly build.

How it’s checked

Measured against the reference tools

Each codec is measured against its reference tool (zstd, lz4, libdeflate, zlib-ng, bzip2, xz, lzip and 7-Zip) on Silesia, enwik8 and small game payloads. The target is a size within 1% and at least 0.87 of the tool’s speed at every level, and the overview has every row. Output is byte-identical across x64 and arm64, JIT and NativeAOT, and WebAssembly.

The packages

Go further