Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Make API more dev friendly #13

Closed
daviddias opened this issue May 17, 2016 · 8 comments
Closed

Make API more dev friendly #13

daviddias opened this issue May 17, 2016 · 8 comments
Assignees

Comments

@daviddias
Copy link
Contributor

@haadcode you had a proposal to make the default encoding of strings (in a multihash) to be base58 (and not multihash.toString), could you confirm and if possible, make a PR to update the tests with that?

@hackergrrl
Copy link
Contributor

Hey @diasdavid could you clarify this a bit more? Is this how strings are described in API docs, or how we manage them in tests? Could you give an example?

@dignifiedquire
Copy link
Contributor

dignifiedquire commented May 20, 2016

Today you have to write

const myHash = 'Qm...'
object.get(myHash, {enc: 'base58'})

what we want is

object.get(myHash)

so that the default encoding for passing a string based multihash is base58

@hackergrrl
Copy link
Contributor

Ah! Yes, that makes sense and would be really nice. Thanks @dignifiedquire :)

@daviddias
Copy link
Contributor Author

@haadcode would you like to revisit your proposal? Now that CIDv1 is coming (ipfs/specs#130)

@daviddias
Copy link
Contributor Author

🛎 @haadcode

@haadcode
Copy link
Contributor

haadcode commented Aug 16, 2016

What was proposed here still makes sense imo. I can look into making a PR later this week (I hope).

Now that CIDv1 is coming (ipfs/specs#130)

Can you elaborate how CID would change what is been requested here? Imo the .get() API should be clever and recognize between multihash, CID, multbase, multimulti and all other other formats :)

@daviddias
Copy link
Contributor Author

Because the CID already carry the encoding format, the multibase, so saying:

object.get(CID, { enc: 'base58' }) is redundant

@daviddias
Copy link
Contributor Author

DAG API is currently a WIP. Feedback is highly appreciated and now it is the best time to make sure if gets solidified with everyone's input, please add your comments and review there #99

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

4 participants