6 for (var i = 0; i < 256; i++) {
8 for (var j = 0; j < 8; j++) {
10 currentCrc = 0xedb88320 ^ (currentCrc >>> 1);
13 currentCrc = currentCrc >>> 1;
16 crcTable[i] = currentCrc;
20 var CrcCalculator = module.exports = function() {
24 CrcCalculator.prototype.write = function(data) {
26 for (var i = 0; i < data.length; i++) {
27 this._crc = crcTable[(this._crc ^ data[i]) & 0xff] ^ (this._crc >>> 8);
32 CrcCalculator.prototype.crc32 = function() {
33 return this._crc ^ -1;
37 CrcCalculator.crc32 = function(buf) {
40 for (var i = 0; i < buf.length; i++) {
41 crc = crcTable[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8);