Skip to content

Commit

Permalink
storage: use fast-crc32c conditionally (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored and callmehiphop committed Jun 7, 2016
1 parent ebf5e7b commit 902d03f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/storage/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,11 @@ Bucket.prototype.makePublic = function(options, callback) {
* `options.resumable`. *Resumable uploads are enabled by default if your input
* file is larger than 5 MB.*
*
* For faster crc32c computation, you must manually install
* [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
*
* $ npm install --save fast-crc32c
*
* @resource [Upload Options (Simple or Resumable)]{@link https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload#uploads}
* @resource [Objects: insert API Documentation]{@link https://cloud.google.com/storage/docs/json_api/v1/objects/insert}
*
Expand Down
10 changes: 10 additions & 0 deletions lib/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ File.prototype.copy = function(destination, callback) {
* "CONTENT_DOWNLOAD_MISMATCH". If you receive this error, the best recourse is
* to try downloading the file again.
*
* For faster crc32c computation, you must manually install
* [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
*
* $ npm install --save fast-crc32c
*
* NOTE: Readable streams will emit the `end` event when the file is fully
* downloaded.
*
Expand Down Expand Up @@ -708,6 +713,11 @@ File.prototype.createResumableUpload = function(options, callback) {
* Resumable uploads are automatically enabled and must be shut off explicitly
* by setting `options.resumable` to `false`.
*
* For faster crc32c computation, you must manually install
* [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
*
* $ npm install --save fast-crc32c
*
* NOTE: Writable streams will emit the `finish` event when the file is fully
* uploaded.
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"google-auto-auth": "^0.2.4",
"google-proto-files": "^0.1.1",
"grpc": "^0.14.1",
"hash-stream-validation": "^0.1.0",
"hash-stream-validation": "^0.2.1",
"is": "^3.0.1",
"lodash.flatten": "^4.2.0",
"methmeth": "^1.0.0",
Expand Down

0 comments on commit 902d03f

Please sign in to comment.