CollapseLauncher / SharpHDiffPatch.Core

A port of original HDiffPatch by housisong, written in C# and .NET Standard 2.0 compatible
MIT License
27 stars 6 forks source link

LZMA support #3

Open pkr-sadx opened 8 months ago

pkr-sadx commented 8 months ago

Hi! Thank you for making this tool. Could you add support for LZMA2 compression type? Much appreciated!

neon-nyan commented 8 months ago

Hi there! Thank you for the request. The support will be planned to come in the future but since there's lack of third party codes for supporting LZMA (especially LZMA2) in C#, I need to find a way to get this to work and it might take some time.

neon-nyan commented 7 months ago

Hi there,

Just to let you know that I just shipped a support for LZMA2. But unfortunately, I still need to figure out how to make it available for LZMA due to some issues. Keep in mind that the current implementation of LZMA2 decompression is slow due to it written in pure-managed C# code (using managed-lzma by weltkante)

I will drop a release of the compiled executable soon (v2.1.x)

pkr-sadx commented 7 months ago

Hi! Thanks for letting me know.

I pulled the latest commit and tried an LZMA2 patch over a folder, and it worked without issues. In my use case LZMA patches created by hdiffz come out slightly smaller than LZMA2 patches, but the difference is only about 1KB. With BZIP2 and zlib there's an almost 2MB difference, so LZMA2 is a major improvement.

BZIP2: 6 011 559 bytes LZMA: 4 778 723 bytes LZMA2: 4 779 809 bytes zlib: 6 609 591 bytes

Appreciate your hard work and will be happy to test other stuff.