Forum > Packages and Libraries

LZ-String compress decompress

<< < (2/2)


--- Quote from: Thaddy on July 23, 2022, 09:20:45 am ---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.

--- End quote ---

i think what dkur need is lz-string pieroxy

--- Quote from: dkur on July 23, 2022, 03:18:48 pm ---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.

--- End quote ---

You can use Mormot SynCommons, SynCrypto to decrypt AES-256-CBC

Regards Benny

compiler/cutils.pas contains an "Ultra basic KISS Lzw (de)compressor". You have to change string to shortstring in order to make sure it compiles because it contains inc(minilzw_*encode[0]), thus modifying the string length directly, without the setlength procedure. Obviously, the original code can be modified especially because "It's a pity that we still need those awfull tricks with this modern compiler. Without this performance of the entire procedure drops about 3 times.". Most likely, the comment regards the use of a label.

Is it the bugfix for FPC? How does it work yet w/o bugfix?

This is a working LZW decompressor. Works fine with Unix compress .Z files:


[0] Message Index

[*] Previous page

Go to full version