Skip to content

Commit f228356

Browse files
committed
Merge pull request #24 from facundoolano/digest_fix
converted hash.update string parameter to buffer
2 parents 4552197 + 774a435 commit f228356

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ function hash(alg, key) {
4040
if(!fn) error('algorithm:', alg, 'is not yet supported')
4141
return {
4242
update: function (data) {
43+
if(!Buffer.isBuffer(data)) data = new Buffer(data)
44+
4345
bufs.push(data)
4446
length += data.length
4547
return this

0 commit comments

Comments
 (0)