Tuesday 20 October 2020

What's the encoding should I use to "gzuncompress()" in node.js?

I'm converting my code from PHP to node.js, and I need to convert a part of my code where there's the gzuncompress() function.

For that I'm using zlib.inflateSync. But I don't know which encoding I should use to create the buffer and so to have the same result of php

Here's what I do with php to decompress a string:

gzuncompress(substr($this->raw, 8))

and here's what I've tried in node.js

zlib.inflateSync(new Buffer(this.raw.substr(8), "encoding"))

So what encoding should I use to make zlib.inflateSync returns the same data as gzuncompress ?



from What's the encoding should I use to "gzuncompress()" in node.js?

No comments:

Post a Comment