From 4a0e81eb6238aee51e81ae6ba1258083ed666b5c Mon Sep 17 00:00:00 2001 From: Anand Suresh Date: Thu, 9 Apr 2015 11:07:34 -0700 Subject: [PATCH 1/2] Update CRC module to SSE4_CRC32 v3.1.0 - v3.1.0 fixes issues with hardware CRC detection and provides software fallbalck for platforms lacking hardware CRC support. - Reduces the number of layers between core code and the CRC functions --- AUTHORS | 3 ++- CONTRIBUTORS | 1 + lib/storage/file.js | 2 +- package.json | 2 +- test/storage/file.js | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index f81f0cec3f2..4f1a9fdc3fc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,4 +6,5 @@ # Name or Organization # The email address is not required for organizations. -Google Inc. \ No newline at end of file +Google Inc. +Anand Suresh diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9f2214f8a9f..275c55a040f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -16,3 +16,4 @@ Johan Euphrosine Patrick Costello Silvano Luciani Stephen Sawchuk +Anand Suresh diff --git a/lib/storage/file.js b/lib/storage/file.js index c9389e10f5f..a42635653c7 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -22,7 +22,7 @@ var bufferEqual = require('buffer-equal'); var ConfigStore = require('configstore'); -var crc = require('fast-crc32c'); +var crc = require('sse4_crc32'); var crypto = require('crypto'); var duplexify = require('duplexify'); var fs = require('fs'); diff --git a/package.json b/package.json index a50b0a9a72b..d9cd42ed8cd 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "configstore": "^0.3.2", "duplexify": "^3.2.0", "extend": "^2.0.0", - "fast-crc32c": "^0.1.3", + "sse4_crc32": "^3.1.0", "google-auth-library": "^0.9.4", "mime-types": "^2.0.8", "node-uuid": "^1.4.2", diff --git a/test/storage/file.js b/test/storage/file.js index 857478ab290..a90c29a6eaf 100644 --- a/test/storage/file.js +++ b/test/storage/file.js @@ -20,7 +20,7 @@ var assert = require('assert'); var Bucket = require('../../lib/storage/bucket.js'); -var crc = require('fast-crc32c'); +var crc = require('sse4_crc32'); var crypto = require('crypto'); var duplexify = require('duplexify'); var extend = require('extend'); From 3d6e16392c5238b58127733fd9d16d066e62d903 Mon Sep 17 00:00:00 2001 From: Ryan Seys Date: Mon, 27 Apr 2015 18:55:43 -0400 Subject: [PATCH 2/2] Fix self-register of crc32c --- test/storage/file.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/storage/file.js b/test/storage/file.js index a90c29a6eaf..6f10372c95e 100644 --- a/test/storage/file.js +++ b/test/storage/file.js @@ -92,6 +92,7 @@ describe('File', function() { var bucket; before(function() { + mockery.registerMock('sse4_crc32', crc); mockery.registerMock('configstore', FakeConfigStore); mockery.registerMock('duplexify', FakeDuplexify); mockery.registerMock('request', fakeRequest);