Skip to content

Commit 774a435

Browse files
committed
converted update string parameter to buffer
1 parent 4552197 commit 774a435

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)