mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
Merge pull request #2505 from resin-io/fix-xxhash-digest-read
fix: Provide a Buffer to xxhash.Stream
This commit is contained in:
commit
e85e1410aa
@ -73,7 +73,7 @@ class ChecksumStream extends stream.Transform {
|
|||||||
// Seed value 0x45544348 = ASCII "ETCH"
|
// Seed value 0x45544348 = ASCII "ETCH"
|
||||||
const seed = 0x45544348
|
const seed = 0x45544348
|
||||||
const is64Bit = process.arch === 'x64' || process.arch === 'aarch64'
|
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 {
|
} else {
|
||||||
hash = _.attempt(crypto.createHash, algorithm)
|
hash = _.attempt(crypto.createHash, algorithm)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user