Skip to content

Commit d308cb0

Browse files
committed
hash: update never returns anything
1 parent 03702a8 commit d308cb0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

hash.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ Hash.prototype.digest = function (enc) {
6464
this._block.writeUInt32BE(ll, this._blockSize - 4)
6565
}
6666

67-
var hash = this._update(this._block) || this._hash()
67+
this._update(this._block)
68+
var hash = this._hash()
6869

6970
return enc ? hash.toString(enc) : hash
7071
}

test/hash.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ var long = {
4343

4444
function makeTest (name, data) {
4545
tape(name, function (t) {
46-
4746
var h = new Hash(16, 8)
4847
var hash = new Buffer(20)
4948
var n = 2
@@ -57,7 +56,8 @@ function makeTest (name, data) {
5756
if (n < 0) {
5857
throw new Error('expecting only 2 calls to _update')
5958
}
60-
59+
}
60+
h._hash = function () {
6161
return hash
6262
}
6363

0 commit comments

Comments
 (0)