Skip to content

Commit

Permalink
Merge pull request #5 from addaleax/fix-default-encoding
Browse files Browse the repository at this point in the history
Explicitly set default encoding in createHash()
  • Loading branch information
malept authored Feb 23, 2017
2 parents 408c99f + 2a395e2 commit 0874486
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ChecksumValidator {
let fullPath = path.resolve(baseDir, filename)
debug(`Reading file with "${this.encoding(binary)}" encoding`)
let stream = fs.createReadStream(fullPath, {encoding: this.encoding(binary)})
let hasher = crypto.createHash(this.algorithm)
let hasher = crypto.createHash(this.algorithm, {defaultEncoding: 'binary'})
hasher.on('readable', () => {
let data = hasher.read()
if (data) {
Expand Down

0 comments on commit 0874486

Please sign in to comment.