regular / unbzip2-stream

streaming unbzip2 implementatio in pure javascript for node and browsers
Other
29 stars 23 forks source link

Handle stream CRC of empty streams correctly #32

Closed sfriesel closed 4 years ago

sfriesel commented 4 years ago

streamCRC being null indicates that the last BZ2 stream ended or none has started yet. Once in a BZ2 stream, the value needs to be initialized to 0 even when it contains no blocks to pass the final CRC check. A completely empty input stream leaves streamCRC at null and likewise produces an empty output.

sfriesel commented 4 years ago

Fixes #31

regular commented 4 years ago

Thanks for your immediate action, Stefan!