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

@@ -8,6 +8,7 @@ const assert = require('assert'),
debug = require('debug')('box:backupformat/tgz'),
{ DecryptStream, EncryptStream } = require('../hush.js'),
fs = require('fs'),
HashStream = require('../hash-stream.js'),
path = require('path'),
ProgressStream = require('../progress-stream.js'),
promiseRetry = require('../promise-retry.js'),
@@ -141,7 +142,7 @@ async function tarPack(dataLayout, encryption, uploader, progressCallback) {
const pack = tar.pack();
const hash = crypto.createHash('sha256');
const hash = new HashStream();
let pipeline = null;
if (encryption) {