compressjs
compressjs copied to clipboard
bzip2 CRC error: incompatibility with command line bunzip2 v 1.0.6
Using [email protected] and node v 11.4.0
compressjs.Bzip2 can produce output that the bunzip2 command line program, v 1.0.6 as distributed with Ubuntu 18.10, declares to have a CRC error.
The attached repro case compresses a large json file using Bzip2, once with blocksize 800k, and again with blocksize 900k.
bunzip2 of the compressed file of block size 800k succeeds. bunzip2 of the compressed file of block size 900k fails.
error Error: Command failed: bunzip2 -t message.9.json.bz2
bunzip2: message.9.json.bz2: data integrity (CRC) error in data
To run the repro case, bunzip2 must be on your path. Then run
node index.js
I should add that compressjs.Bzip2 decompresses the 900k buffer just fine. The issue here is compatibility with the popular command line tool. Not saying there's a bug in compressjs -- could be in the command line tool.