Forum > Packages and Libraries

LZ-String compress decompress

(1/2) > >>

I want to know, is there any LZ-String implementation in pascal/lazarus ?.
Just something like this :

Sorry for my bad english

Yours faithfully,

Hello dkur,
Welcome to the forum.

I inspected into the source code of ZBase.pas, the Lazarus/FPC component for handling compression. It does mention LZ77, see line #91 in the picture below:

Hi, thanks for your reply.
I need LZ-String implementation for my laz coding. It seems that zbase not fit for my coding.
I need to decode json output from uricomponent method.

Which LZ do you need? LZO, LZ4, LZ77, LZ78, LZP, LZH,  LZ77, LZSS, LZMA, LZW and more? There are many flavors, but you simply state LZ.
Lempel-Ziff on its own is more of an academic excercise and hardly used on its own.
Lempel-Ziff-Hoffman is a practical implementation and so is e.g the Lempel-Ziff-Storer-Symanski.
The code you link to isn't too clear about what is implemented. Just that it can do lossless compress and decompress.
It misses any academic reference.
(I suspect you just need a deflate)
All these algorithms are rather simple to implement for an intermediate programmer, but without knowing the flavor I can not help you.
Maybe zlib will work and comes as standard package in the fpc distribution. It is also standards conformant.
It contains extensive documentation in the sourcecode (so you need the package sourcecode -: zlib.pas. It also works to decompress Python compressed sources and vice-versa, so that may be the right one.

Hi, thanks for you reply
Sory for my respon before, not decoded, what i mean or need is LZ-String code in pascal to decompress json file, the json file before, was encrypted by aes & sha256. LZ-string, i think its implementation of lzw algorithm.

In the link i mentioned before, it was lz string write in java. In github also there was go, vb net, c# code for lz string but none in pascal.

Sory for my bad english.


[0] Message Index

[#] Next page

Go to full version