Home > Web Front-end > JS Tutorial > body text

Nodejs gzip decompression base64 method

一个新手
Release: 2017-09-27 09:42:11
Original
2963 people have browsed it

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());
    }
});
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template