Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

utils.cid should uses the serialized dag node #7

Closed
wanderer opened this issue Aug 8, 2017 · 1 comment
Closed

utils.cid should uses the serialized dag node #7

wanderer opened this issue Aug 8, 2017 · 1 comment

Comments

@wanderer
Copy link
Member

wanderer commented Aug 8, 2017

can utils.cid take in the serialized dag node instead of the node it self?

Proposal

util.cid(serializedNode, callback)

get the CID of the serialized dagNode

callback must have the signature function (err, cid), where err is an Error is the function fails and cid is a CID instance of the dagNode.

Rational

Currently resolver.put need to serialize the data twice (here and here). This causes preformance overhead can lead to rather confusing bugs.

@daviddias
Copy link
Member

Added to spec update proposal. Let's follow up on the discussion there -> #11 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants