Yep, it is the same hash as if we had the full value. Here is an example:
If we had all the data upfront:
> crc32c(new Buffer('data1data2data3'))
772160458
If we have to calculate bit-by-bit:
GOOGLE_APPLICATION_CREDENTIALS=/Users/stephen/dev/key.json |
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %> | |
'use strict'; | |
var moment = require('moment'); | |
var LIVERELOAD_PORT = 35729; | |
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT}); | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; |
diff --git a/system-test/storage.ts b/system-test/storage.ts | |
index 15465b9..a096b65 100644 | |
--- a/system-test/storage.ts | |
+++ b/system-test/storage.ts | |
@@ -111,6 +111,7 @@ describe('storage', () => { | |
process.env.GOOGLE_APPLICATION_CREDENTIALS; | |
delete process.env.GOOGLE_APPLICATION_CREDENTIALS; | |
+ delete require.cache[require.resolve('../src')]; | |
const {Storage} = require('../src'); |
Yep, it is the same hash as if we had the full value. Here is an example:
If we had all the data upfront:
> crc32c(new Buffer('data1data2data3'))
772160458
If we have to calculate bit-by-bit:
function partialResultStream(requestFn, options) { | |
var lastResumeToken; | |
var activeRequestStream; | |
options = extend({toJSON: false}, options); | |
function makeRequest() { | |
requestFn(lastResumeToken).pipe(userStream) | |
} |
'use strict' | |
const arrify = require('arrify') | |
const log = require('kittie') | |
const pubsub = require('./lib/pubsub')({ | |
keyFilename: './keyfile.json' | |
}) | |
let count = 0; |
Memory Usage: 21Mb | |
Memory Usage: 32Mb | |
Memory Usage: 28Mb | |
Memory Usage: 25Mb | |
Memory Usage: 23Mb | |
Memory Usage: 36Mb | |
Memory Usage: 33Mb | |
Memory Usage: 31Mb | |
Memory Usage: 28Mb |
Memory Usage: 21Mb | |
Memory Usage: 32Mb | |
Memory Usage: 28Mb | |
Memory Usage: 25Mb | |
Memory Usage: 23Mb | |
Memory Usage: 36Mb | |
Memory Usage: 33Mb | |
Memory Usage: 31Mb | |
Memory Usage: 28Mb |
export GCLOUD_TESTS_KEY='path/to/user-a-service-account-keyfile.json' | |
export GCLOUD_TESTS_PROJECT_ID='user-a-project-id' | |
export GCLOUD_TESTS_KEY_NON_WHITELIST='path/to/user-b-service-account-keyfile.json' | |
export GCLOUD_TESTS_PROJECT_ID_NON_WHITELIST='user-b-project-id' | |
git clone git@github.com:stephenplusplus/gcloud-node | |
cd gcloud-node | |
git checkout -b spp--2371 origin/spp--2371 | |
cd packages/storage |
var pumpify = require('pumpify') | |
var through = require('through2') | |
function makeGrpcStreamingRequest() { | |
var transformStream = through.obj(function(obj, enc, next) { | |
obj.transformed = true | |
next(null, obj) | |
}) | |
var grpcRequestStream = through.obj() |