Skip to content

Commit 902d03f

Browse files
stephenpluspluscallmehiphop
authored andcommitted
storage: use fast-crc32c conditionally (#1367)
1 parent ebf5e7b commit 902d03f

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

lib/storage/bucket.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,11 @@ Bucket.prototype.makePublic = function(options, callback) {
923923
* `options.resumable`. *Resumable uploads are enabled by default if your input
924924
* file is larger than 5 MB.*
925925
*
926+
* For faster crc32c computation, you must manually install
927+
* [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
928+
*
929+
* $ npm install --save fast-crc32c
930+
*
926931
* @resource [Upload Options (Simple or Resumable)]{@link https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#uploads}
927932
* @resource [Objects: insert API Documentation]{@link https://cloud.google.com/storage/docs/json_api/v1/objects/insert}
928933
*

lib/storage/file.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ File.prototype.copy = function(destination, callback) {
409409
* "CONTENT_DOWNLOAD_MISMATCH". If you receive this error, the best recourse is
410410
* to try downloading the file again.
411411
*
412+
* For faster crc32c computation, you must manually install
413+
* [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
414+
*
415+
* $ npm install --save fast-crc32c
416+
*
412417
* NOTE: Readable streams will emit the `end` event when the file is fully
413418
* downloaded.
414419
*
@@ -708,6 +713,11 @@ File.prototype.createResumableUpload = function(options, callback) {
708713
* Resumable uploads are automatically enabled and must be shut off explicitly
709714
* by setting `options.resumable` to `false`.
710715
*
716+
* For faster crc32c computation, you must manually install
717+
* [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
718+
*
719+
* $ npm install --save fast-crc32c
720+
*
711721
* NOTE: Writable streams will emit the `finish` event when the file is fully
712722
* uploaded.
713723
*

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"google-auto-auth": "^0.2.4",
105105
"google-proto-files": "^0.1.1",
106106
"grpc": "^0.14.1",
107-
"hash-stream-validation": "^0.1.0",
107+
"hash-stream-validation": "^0.2.1",
108108
"is": "^3.0.1",
109109
"lodash.flatten": "^4.2.0",
110110
"methmeth": "^1.0.0",

0 commit comments

Comments
 (0)