pierrec / node-lz4

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

Invalid checksum failures #52

Open buu700 opened 7 years ago

buu700 commented 7 years ago

I'm not entirely sure why, but when testing this library I was almost consistently getting checksum failures during decompression, which I know for a fact were false positives because the data being compressed/decompressed was also being cryptographically signed/validated to ensure integrity.

Everything is working as expected with streamChecksum set to false (which is a good enough workaround for my use case, given the aforementioned signing), so it seems like this must be an issue with the checksumming specifically, and not just a general encoding/decoding failure.

I didn't test all that exhaustively, and can't say what about my test case was special enough to cause this, but a few guesses as to the root cause:

(As far as the actual error message: I thought I'd saved it somewhere, but apparently not. That said, I recall something about magic numbers, if that helps.)

pierrec commented 7 years ago

Thanks for the report. I think I know what that is but I would like to confirm. If you have a sample file that exhibits the failure, please provide it.