Jump to content



Photo

LZMA Compression UDF


  • Please log in to reply
1 reply to this topic

#1 Ward

Ward

    Adventurer

  • Active Members
  • PipPip
  • 140 posts

Posted 28 March 2010 - 10:05 PM

How to compress data in memory? The simplest way is to use the Native API Compression by trancexx. Here provides another way, using LZMA algorithm. LZMA is the default method of 7z format, provides a high compression ratio and very fast decompression.

In this UDF, embedded and external DLL are both supported. If "LZMA.DLL.AU3" (embedded binary) is not included in scripts, a external LZMA.DLL must exists. You can use external DLL if MemoryDll is not work for you.

Some tips:
  • Both LzmaEnc and LzmaDec only accept binary arguments. To compress string, StringToBinary and BinaryToString can help.
  • LzmaEnc can accept an extra argument, the comression level, from 1 to 9. For example: LzmaEnc($Binary, 9)
  • More settings are support by LzmaEncSetting, please see LZMA SDK.
  • This UDF is not for file compression. To compress files, 7-ZIP UDF is the better choice

Example:
#include "LZMA.AU3" #include "LZMA.DLL.AU3" Local $Source = Binary("LZMALZMALZMALZMALZMALZMALZMALZMALZMALZMA") Local $Compressed = LzmaEnc($Source) Local $Decompressed = LzmaDec($Compressed)


Attached File  LZMA.zip   51.24K   669 downloads
  • n1maS likes this





#2 BoonPek

BoonPek

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 08 August 2011 - 08:46 AM

This looks interesting, and is vital to my script. Can anyone here please eh... revive this? :mellow:

Sorry for the necrobump, I'd like a function that can decompress LZMA files without the requirement of an external DLL :)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users