Home  >  Article  >  Web Front-end  >  Nodejs gzip decompression base64 method

Nodejs gzip decompression base64 method

一个新手
一个新手Original
2017-09-27 09:42:112947browse

zlib comes with nodejs. You can directly use
the following code to compress and decompress base64 gzip

Reference documentation https://nodejs.org/api/zlib.html

const zlib = require('zlib');var buffer = new Buffer('H4sIAAAAAAAAAIuOBQApu0wNAgAAAA==', 'base64');
zlib.unzip(buffer, function(err, buffer) {
    if (!err) {
        console.log(buffer.toString());
    }
});

The above is the detailed content of Nodejs gzip decompression base64 method. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn