git ssb

1+

Dominic / ssb-keys



Commit 441d57ee790defbd1617fdf35f4025a4450be80c

encode strings the future proof (but wrong) way

Dominic Tarr committed on 3/26/2016, 7:20:12 AM
Parent: 94ad29364a5682156f86894505f5e7118f39589b

Files changed

index.jschanged
index.jsView
@@ -27,9 +27,14 @@
2727 return _obj
2828 }
2929
3030 function hash (data, enc) {
31- return crypto.createHash('sha256').update(data,enc).digest('base64')+'.sha256'
31+ data = (
32+ 'string' === typeof data && enc == null
33+ ? new Buffer(data, 'binary')
34+ : new Buffer(data, enc)
35+ )
36+ return crypto.createHash('sha256').update(data).digest('base64')+'.sha256'
3237 }
3338
3439 var isLink = ssbref.isLink
3540 var isFeedId = ssbref.isFeedId

Built with git-ssb-web