ipld / js-ipld-block

Implementation of the Block data structure in JavaScript.
MIT License
13 stars 16 forks source link

Repurpose ipfs-block as a container for { data, cid } #25

Closed kumavis closed 7 years ago

kumavis commented 7 years ago

currently it is a wrapper around the data that adds a utility method for generating the multihash.

block.key(hashFn, cb) is not much better than hash(hashFn, block.data, cb).

Instead I propose we repurpose this as a container around { data, cid } since that is not captured in a standard interface yet but use it in a number of places.

daviddias commented 7 years ago

Happening here: https://github.com/ipfs/js-ipfs-block/pull/31