Skip to content
Advertisement

Tag: pako

I want to decompress a GZIP string with JavaScript

I have this GZIPed string: H4sIAAAAAAAA//NIzcnJVyguSUzOzi9LLUrLyS/XUSjJSMzLLlZIyy9SSMwpT6wsVshIzSnIzEtXBACs78K6LwAAAA== I created that with this website: http://www.txtwizard.net/compression I have tried using pako to ungzip it. The issue is that Pako throws the error: incorrect header check What am I missing here? A JSbin Answer The “H4sIAAAAAAAA//NIzcnJVyguSUzOzi9LLUrLyS/XUSjJSMzLLlZIyy9SSMwpT6wsVshIzSnIzEtXBACs78K6LwAAAA==” is a base64 encoded string, you first need to decode that into a buffer. textEncoder.encode just encodes that

Advertisement