AuroraLib.Compression
1.5.0
dotnet add package AuroraLib.Compression --version 1.5.0
NuGet\Install-Package AuroraLib.Compression -Version 1.5.0
<PackageReference Include="AuroraLib.Compression" Version="1.5.0" />
paket add AuroraLib.Compression --version 1.5.0
#r "nuget: AuroraLib.Compression, 1.5.0"
// Install AuroraLib.Compression as a Cake Addin #addin nuget:?package=AuroraLib.Compression&version=1.5.0 // Install AuroraLib.Compression as a Cake Tool #tool nuget:?package=AuroraLib.Compression&version=1.5.0
AuroraLib.Compression
AuroraLib.Compression is a high-performance, memory-efficient library for a broad range of compression algorithms primarily used in video games. Designed for seamless use across multiple .NET versions. Written entirely in managed C#, it eliminates the need for external C++ libraries while offering fast decompression and compression.
Supported Algorithms
AuroraLib.Compression
Algorithm | Description |
---|---|
LZ10 | Nintendo LZ10 compression used in various GBA, DS and WII games. |
LZ11 | Nintendo LZ11 compression used in various DS and WII games. |
LZ77 | Nintendo LZ77 based on LZ10 used in WII games and data. |
MIO0* | Nintendo MIO0 compression mainly used in early Nintendo 64 games. |
Yay0* | Nintendo YAY0 compression used in some Nintendo 64 and GameCube games. |
Yaz0* | Nintendo Yaz0 compression used in games from the N64 to Switch era. |
Yaz1* | Identical to Yaz0 used for data on the N64DD. |
HUF20 | Nintendo Huffman compression algorithm, mainly used in GBA and DS games. |
RLE30 | Nintendo RLE compression algorithm used in GBA games. |
PRS* | Sega PRS compression algorithm used in various Sega games. |
ALLZ | Aqualead LZ compression algorithm used by a handful of games. |
LZO | Lempel–Ziv–Oberhumer algorithm, focused on decompression speed |
LZOn | Nintendo LZOn compression algorithm mainly used in DS Download Games. |
RefPack | RefPack compression algorithm used in some EA games. |
GZip | GZip based on DEFLATE compression algorithm. |
ZLib | ZLib based on DEFLATE compression algorithm. |
*
Big-endian and little-endian version are supported.
AuroraLib.Compression-Extended
Algorithm | Description |
---|---|
LZ40 | Nintendo LZ40 compression mainly used in DS games. |
LZ60 | Nintendo LZ60 corresponds to LZ40 algorithm. |
HWGZ* | Hyrule Warriors GZ compression format based on ZLib. |
LZSega | A LZSS based compression algorithm used in some Sega GameCube games. |
CNX2 | Sega CNX2 algorithm, used in some Puyo Puyo. |
COMP | Sega COMP based on LZ11 algorithm, used in some Puyo Puyo. |
CXLZ | Sega CXLZ based on LZ10 algorithm, used in some Puyo Puyo. |
LZ00 | Sega LZ00 is based on LZSS algorithm with encryption. |
LZ01 | Sega LZ01 based on LZSS algorithm, used in some Puyo Puyo. |
AKLZ | A LZSS based algorithm used in Skies of Arcadia Legends. |
CNS | CNS compression algorithm, used in Games from Red Entertainment. |
CLZ0 | CLZ0 compression algorithm, used in Games from Victor Interactive Software. |
FCMP | FCMP based on LZSS algorithm, used in Muramasa The Demon Blade. |
GCLZ | GCLZ based on LZ10 algorithm, used in Pandora's Tower. |
LZ02 | LZ02 compression algorithm used in Mario Golf: Toadstool Tour. |
LZHudson | A LZSS based compression algorithm used in Mario Party 4-7. |
RLHudson | A RLE based compression algorithm used in Mario Party 4-7. |
LZShrek | LZShrek compression algorithm used in Shrek Super Slam. |
LZSS | LZSS compression algorithm used in many games. |
AsuraZlb | AsuraZlb based on ZLib compression algorithm used in Simpsons The Game. |
ZLB | ZLB based on ZLib compression algorithm used in Star Fox Adventures. |
LZ4 | LZ4 is similar to LZO focused on decompression speed. |
MDF0 | Konami MDF0 based on ZLib used in Castlevania: The Adventure ReBirth. |
Level5 | Level5 compression algorithm, mainly used in Level5 3ds games. |
SSZL | Level5 SSZL algorithm base on LZSS, used in Inazuma Eleven 3. |
IECP | IECP algorithm base on LZSS, used in Fate/Extra. |
*
Big-endian and little-endian version are supported.
How To Use
Decompress a File Using a Specific Algorithm
using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
using FileStream destination = new("output.dat", FileMode.Create, FileAccess.ReadWrite, FileShare.None);
new LZSS().Decompress(source, destination);
Compress a File Using a Specific Algorithm
using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
using FileStream destination = new("output.dat", FileMode.Create, FileAccess.ReadWrite, FileShare.None);
new LZSS().Compress(source, destination);
Check If a File Matches a Specific Compression Algorithm
using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
bool canDecompressed = new LZSS().IsMatch(source);
Configure an Compression Encoder
Yaz0 encoder = new Yaz0
{
FormatByteOrder = Endian.Big, // Use big-endian byte order
LookAhead = false // Disable look-ahead optimization
};
Automatically Detect and Decompress Using a Recognized Algorithm
FormatDictionary formats = new FormatDictionary(AppDomain.CurrentDomain.GetAssemblies());
using FileStream source = new("input.dat", FileMode.Open, FileAccess.Read, FileShare.Read);
ReadOnlySpan<char> fileName = Path.GetFileName("input.dat");
if (formats.Identify(source, fileName, out IFormatInfo format) && format.Class != null)
{
var decoder = format.CreateInstance();
if (decoder is ICompressionDecoder compressionDecoder)
{
using Stream destination = compressionDecoder.Decompress(source);
// Use the decompressed stream as needed
}
}
Credits
- Nickworonekin Puyo Tools inspired the LZ Decode and Encode code and reference for CNX2, LZ00, LZ01, LZ10, LZ11, PRS algorithms.
- Haruhiko Okumura reference his original C implementation of the LZSS algorithm.
- Daniel-McCarthy reference for MIO0, YAZ0, YAY0 algorithm.
- Kuriimu reference for HUF20 algorithm.
- Niotso.wiki reference for RefPack algorithm.
- Sukharah reference for CLZ0 algorithm.
- Gamemasterplc reference for LZHudson algorithm.
- KirbyUK reference for LZShrek algorithm.
- Brolijah reference for ALLZ algorithm.thm.
- CUE reference for LZ40 algorithm.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. |
.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 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. 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. |
-
.NETFramework 4.7.2
- AuroraLib.Core (>= 1.6.2)
-
.NETStandard 2.0
- AuroraLib.Core (>= 1.6.2)
-
.NETStandard 2.1
- AuroraLib.Core (>= 1.6.2)
-
net6.0
- AuroraLib.Core (>= 1.6.2)
-
net8.0
- AuroraLib.Core (>= 1.6.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AuroraLib.Compression:
Package | Downloads |
---|---|
AuroraLib.Compression-Extended
Has additional specific compression algorithms that are rarely used. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on AuroraLib.Compression:
Repository | Stars |
---|---|
X-Hax/sa_tools
Sonic Adventure Toolset
|
|
Amethyst-szs/MoonFlow
Modding application for Super Mario Odyssey, specializing in text editing and event flowcharts
|
Version | Downloads | Last updated |
---|---|---|
1.5.0 | 60 | a day ago |
1.4.1 | 128 | 2 months ago |
1.4.0 | 182 | 2 months ago |
1.3.0.1 | 369 | 4 months ago |
1.3.0 | 109 | 5 months ago |
1.2.1 | 120 | 5 months ago |
1.2.0.1 | 292 | 5 months ago |
1.2.0 | 223 | 6 months ago |
1.1.1 | 426 | 9 months ago |
1.1.0 | 108 | 9 months ago |
1.0.6 | 555 | 2/13/2024 |
1.0.5.1 | 130 | 2/4/2024 |
1.0.4 | 251 | 12/13/2023 |
1.0.3 | 203 | 11/17/2023 |