node.jsの別のプロセスで発生する可能性のある別の状態で使用するためにcrypto.createHash('sha1')
(で満たされた後)の現在の状態を保存する方法は?hash.update(buffer)
http request
私はこのようなことを想像します:
var crypto = require('crypto'),
hash = someDatabase.read('hashstate') // continue with filled hash
|| crypto.createHash('sha1'); // start a new hash
// update the hash
someObj.on('data', function(buffer){
hash.update(buffer);
});
someObj.on('end', function(){
// store the current state of hash to retrieve it later (this won't work:)
someDatabase.write('hashstate', hash);
if(theEndOfAllRequests){
// create the result of multiple http requests
hash.digest('hex');
}
});