How to use the adm-zip/util/index.js.crc32 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
setData: function(value) {
                    uncompressedData = Utils.toBuffer(value);
                    if (!_isDirectory && uncompressedData.length) {
                        _entryHeader.size = uncompressedData.length;
                        _entryHeader.method = Utils.Constants.DEFLATED;
                        _entryHeader.crc = Utils.crc32(value);
                    } else {
                        _entryHeader.method = Utils.Constants.STORED;
                    }
                },
                getData: function() {
github imlucas / lone / embed / admzip.js View on Github external
function crc32OK(data) {
                if (_entryHeader.flags & 8 != 8) {
                    if (Utils.crc32(data) != _entryHeader.crc) {
                        return false;
                    }
                } else {}
                return true;
            }
            function decompress(async, callback) {