Recent

Author Topic: LZMA, LZMA2 and XZ  (Read 217 times)

Tomxe

  • Full Member
  • ***
  • Posts: 104
LZMA, LZMA2 and XZ
« on: May 20, 2026, 09:20:33 am »
https://github.com/Xelitan/LZMA-LZMA-XZ-in-pure-Pascal-for-Free-Pascal/

Code: Pascal  [Select][+][-]
  1. procedure LZMACompress(const InStr, OutStr: TStream);
  2. procedure LZMADeCompress(const InStr, OutStr: TStream);
  3.  
  4. procedure LZMACompressFile(const InFile, OutFile: String);
  5. procedure LZMADeCompressFile(const InFile, OutFile: String); //unpacks .lzma
  6.  
  7. procedure LZMA2CompressFile(const InFile, OutFile: String);
  8. procedure LZMA2DeCompressFile(const InFile, OutFile: String); //unpacks .xz
  9.  
  10. procedure LZMA2Compress(const InStr, OutStr: TStream);
  11. procedure LZMA2DeCompress(const InStr, OutStr: TStream);

Thaddy

  • Hero Member
  • *****
  • Posts: 19267
  • Glad to be alive.
Re: LZMA, LZMA2 and XZ
« Reply #1 on: May 20, 2026, 09:29:34 am »
Pure Pascal LZ has been around for... well IONS, centuries, ages...
E.g. Delphi magazine 72, August 2001, Julian Bucknall. (of TurboPower fame)
Even before that I did a version (Zip deflate) in PowerBasic 3 in the 80's but that does not count as Pascal.. 8-)

All the LZ family is related.

So your A.I. effort is welcome, but we all know this for more than 35 years.
« Last Edit: May 20, 2026, 09:55:46 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

Tomxe

  • Full Member
  • ***
  • Posts: 104
Re: LZMA, LZMA2 and XZ
« Reply #2 on: May 20, 2026, 09:50:58 am »
Can the LZ from 2001 unpack .LZMA and .XZ archives created by 7zip?

Thaddy

  • Hero Member
  • *****
  • Posts: 19267
  • Glad to be alive.
Re: LZMA, LZMA2 and XZ
« Reply #3 on: May 20, 2026, 09:58:07 am »
No, but the changes are minor, well, not really minor, but doable when knowing the algorithm improvements. There are also multiple Pascal versions of the 7zip suite after the algorithm was published. Much of those are on Torry's. There is also one on the Embarcadero website (also very, very old)

As I wrote: your effort is welcome, especially since it is against known sources written in C.
« Last Edit: May 20, 2026, 10:02:01 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

Tomxe

  • Full Member
  • ***
  • Posts: 104
Re: LZMA, LZMA2 and XZ
« Reply #4 on: May 20, 2026, 10:00:57 am »
Minor changes for you, impossible work for someone else.
And now it's done and available for anyone via a few nice functions.

Thaddy

  • Hero Member
  • *****
  • Posts: 19267
  • Glad to be alive.
Re: LZMA, LZMA2 and XZ
« Reply #5 on: May 20, 2026, 10:03:01 am »
Agree  :D But note that it has previous implementations....
objects are fine constructs. You can even initialize them with constructors.

Tomxe

  • Full Member
  • ***
  • Posts: 104
Re: LZMA, LZMA2 and XZ
« Reply #6 on: May 20, 2026, 10:13:16 am »
Very well. This is also not a new implementation but a port of liblzma

LemonParty

  • Hero Member
  • *****
  • Posts: 530
Re: LZMA, LZMA2 and XZ
« Reply #7 on: May 20, 2026, 11:24:36 am »
Wow! LZMA has a great compression ratio.
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

 

TinyPortal © 2005-2018