Comparing version 1.1.11 to 1.2.0
{ | ||
"name": "castor", | ||
"version": "1.1.11", | ||
"version": "1.2.0", | ||
"description": "An ES7 [CAS designed](https://en.wikipedia.org/wiki/Content-addressable_storage) file storage for nodejs with a simple API and robust implementation.", | ||
@@ -5,0 +5,0 @@ "main": "store.js", |
@@ -150,3 +150,4 @@ 'use strict'; | ||
var outstream = await createWriteStream(tmp_path); | ||
const fd = fs.openSync(tmp_path, 'w+'); | ||
var outstream = await createWriteStream(tmp_path, {fd}); | ||
var hash = crypto.createHash('md5'); | ||
@@ -156,2 +157,4 @@ hash.setEncoding('hex'); | ||
await Promise.all([pipe(res, hash), pipe(res, outstream)]); | ||
await new Promise(resolve => fs.fsync(fd, resolve)); | ||
const challenge_md5 = hash.read(); | ||
@@ -158,0 +161,0 @@ if(challenge_md5 != file_md5) |
12664
218