From ac068f353acc53de5ed4edd7b06f5791307abb40 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Fri, 12 Oct 2018 15:24:00 +0200 Subject: [PATCH] fix: Provide a Buffer to xxhash.Stream This fixes the digest being a number instead of a buffer. Signed-off-by: Alexis Svinartchouk --- lib/sdk/writer/checksum-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sdk/writer/checksum-stream.js b/lib/sdk/writer/checksum-stream.js index 634ada7c..d93c01ad 100644 --- a/lib/sdk/writer/checksum-stream.js +++ b/lib/sdk/writer/checksum-stream.js @@ -73,7 +73,7 @@ class ChecksumStream extends stream.Transform { // Seed value 0x45544348 = ASCII "ETCH" const seed = 0x45544348 const is64Bit = process.arch === 'x64' || process.arch === 'aarch64' - hash = new xxhash.Stream(seed, is64Bit ? 64 : 32) + hash = new xxhash.Stream(seed, is64Bit ? 64 : 32, Buffer.allocUnsafe(is64Bit ? 8 : 4)) } else { hash = _.attempt(crypto.createHash, algorithm) }