Use hash stream instead of crypto.createHash

crypto.createHash is a write stream but not a PassThrough stream!
This commit is contained in:
Girish Ramakrishnan
2025-08-13 18:38:56 +05:30
parent d875ed5cf5
commit b5c9f034ca
3 changed files with 43 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ const assert = require('assert'),
debug = require('debug')('box:backupformat/rsync'),
{ EncryptStream } = require('../hush.js'),
fs = require('fs'),
HashStream = require('../hash-stream.js'),
hush = require('../hush.js'),
path = require('path'),
paths = require('../paths.js'),
@@ -52,7 +53,7 @@ async function addFile(sourceFile, encryption, uploader, progressCallback) {
progressCallback({ message: `Uploading ${sourceFile}: ${transferred}M@${speed}MBps` }); // 0M@0MBps looks wrong
});
const hash = crypto.createHash('sha256');
const hash = new HashStream();
let pipeline = null;
if (encryption) {