multiformats / js-cid

CID implementation in JavaScript
MIT License
97 stars 39 forks source link

CID constructor throws when multihash uses "identity" algortihm #92

Closed Gozala closed 4 years ago

Gozala commented 5 years ago

Following code throws exception:

const mh = multihash.encode(Buffer.from('abc'), 'identity')
const cid = new CID(0, 'dag-pb', mh)
// Uncaught Error: multihash unknown function code: 0x0