Skip to content

Commit 0874486

Browse files
authored
Merge pull request #5 from addaleax/fix-default-encoding
Explicitly set default encoding in createHash()
2 parents 408c99f + 2a395e2 commit 0874486

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class ChecksumValidator {
138138
let fullPath = path.resolve(baseDir, filename)
139139
debug(`Reading file with "${this.encoding(binary)}" encoding`)
140140
let stream = fs.createReadStream(fullPath, {encoding: this.encoding(binary)})
141-
let hasher = crypto.createHash(this.algorithm)
141+
let hasher = crypto.createHash(this.algorithm, {defaultEncoding: 'binary'})
142142
hasher.on('readable', () => {
143143
let data = hasher.read()
144144
if (data) {

0 commit comments

Comments
 (0)