-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new representation of Mulithash as a string. #82
Conversation
Rename original representation to MultihashBytes.
I'd rather make a clean break or not do this. Having two is just going to be confusing and build up cruft. |
I attempted to do this at first but stopped due the the assumption that a Multihash is a The multihash type itself is very simple so I don't see the problem with having an extra type. We already have a |
Then let's just punt this to later. We don't currently use multihashes for blocks so this shouldn't yet be a performance issue. However, the CID stuff is a pressing performance issue so I'd like to do that now instead of tying these two together. |
Would you be okay with moving all the existing API into a separate package, call it |
If everything goes as plan that should be within a month or so. |
I've just done an initial conversion pass (complete migration) and it wasn't that painful. However, it isn't tied to the go-cid stuff in any way so I don't want to artificially tie them together. |
I am confused as to what this is. Do you mean switching |
Also did you see my comment on:
Basically I would really like the opportunity to clean up and streamline the API during the conversion from changing the internal representation from |
I mean integrating the change: #83
I'd rather not tie the two together unless the API changes are breaking (as far as I can tell, they mostly aren't). Let's do the CID change for now, then this change. If we bundle too much together, we'll never finish anything (and it makes patches impossible to review). |
Already done. |
Okay. Closing this is favor of #84. Please do not delete the branch. |
Unlike the the
Cid
type, theMultihash
has a lot more historical baggage associated with it. It is many places assumed to be a[]byte
. A few functions in fact work with []byte directory instead of the Multihash type. So instead of changing the historical type I renamed it toMultihashBytes
and created a new type that is based on a string. Uses ofMultihash
outside of the Cid can just use theMultihashByte
type instead. There is very little code duplication and this way we don't break uses that assumed or required the Multihash to be[]byte
.