From 18250b5298e27ecd4bcab68f3a42f2ea44589671 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 20 Feb 2014 15:14:09 -0300 Subject: [PATCH] fix crc32 & enable gzip test --- lib/zlib/crc32.js | 4 ++-- test/deflate.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/zlib/crc32.js b/lib/zlib/crc32.js index f62d3d4..8a82d85 100644 --- a/lib/zlib/crc32.js +++ b/lib/zlib/crc32.js @@ -9,7 +9,7 @@ function makeTable() { for(var k =0; k < 8; k++){ c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); } - table[n] = c; + table[n] = c >>> 0; } return table; @@ -23,7 +23,7 @@ function crc32(crc, buf, len, pos) { var t = crcTable , end = pos + len; - crc = 0 ^ (-1); + crc = crc ^ (-1); for (var i = pos; i < end; i++ ) { crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; diff --git a/test/deflate.js b/test/deflate.js index d2d1b7c..176bb4d 100644 --- a/test/deflate.js +++ b/test/deflate.js @@ -26,7 +26,7 @@ describe('Defaults', function () { // OS_CODE can differ. Probably should add param to compare function // to ignore some buffer positions - it.skip('gzip, no options', function(done) { + it('gzip, no options', function(done) { testDeflate(zlib.createGzip, pako.gzip, samples, {}, done); }); });