How to use the adm-zip/headers/index.js.EntryHeader function in adm-zip

To help you get started, we’ve selected a few adm-zip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imlucas / lone / embed / admzip.js View on Github external
module.exports = function(input) {
            var _entryHeader = new Headers.EntryHeader, _entryName = new Buffer(0), _comment = new Buffer(0), _isDirectory = false, uncompressedData = null, _extra = new Buffer(0);
            function getCompressedDataFromZip() {
                if (!input || !Buffer.isBuffer(input)) {
                    return new Buffer(0);
                }
                _entryHeader.loadDataHeaderFromBinary(input);
                return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize);
            }
            function crc32OK(data) {
                if (_entryHeader.flags & 8 != 8) {
                    if (Utils.crc32(data) != _entryHeader.crc) {
                        return false;
                    }
                } else {}
                return true;
            }
            function decompress(async, callback) {