pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
438 stars 98 forks source link

uncompressed file size of high compressed file is wrong? #59

Open serj-kzv opened 6 years ago

serj-kzv commented 6 years ago

I use the code for a high compressed lz4 file

let uncompressedSize = LZ4.decodeBlock(file, uncompressedFile); // error, value is less than zero

but value is negative (below zero :) ) Is that error or I do something wrong?

File is compressed by liblz4-tool. I used ubuntu package.

sudo apt install liblz4-tool
lz4 -z -9 test.txt
serj-kzv commented 6 years ago

UPD I have to say that uncompressing itself works well. If I cut off last zeros manually instead of using uncompressedSize then all is fine. And file is uncompressed correctly.