mafintosh / tar-stream

tar-stream is a streaming tar parser and generator.
MIT License
400 stars 93 forks source link

Fix header decoding sometimes failing in the browser #164

Closed FrederikBolding closed 6 months ago

FrederikBolding commented 6 months ago

Header decoding would sometimes fail in the browser due to mixing of polyfilled Buffer and Uint8Array. I found two instances of calling toString() directly on a Uint8Array eventually leading to the checksum failing. This would happen semi-rarely based on the performance of the stream writing to tar-stream.

I have replaced the toString() calls with usage of b4a.

mafintosh commented 6 months ago

Great find, thanks

FrederikBolding commented 6 months ago

Great find, thanks

You're welcome! I will admit, it took a while to track this one down 😅

If you could let me know once a new version is published, that would be much appreciated! That'll let me remove some patches 😅

mafintosh commented 6 months ago

Done, 3.1.7

FrederikBolding commented 6 months ago

Appreciate it, thanks!