Skip to content
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

Include prefix in Multihash.toString() #35

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vorburger
Copy link

ToDo:

  • Test coverage

@odisseus
Copy link
Contributor

odisseus commented Apr 24, 2024

The premise of this PR is completely wrong.

First, Qm isn't the right prefix for Base58. In fact, no valid Multibase string can start with Q. See specification, implementation.

The hashes that start with Qm are typical (though not required) for IPFS, and they actually don't include the Multibase prefix. See discussion.

Second, the method Base58.encode from io.ipfs.multibase produces results which already include the base prefix. See test examples.

@vorburger
Copy link
Author

@odisseus sorry for a (very) delayed response, but better late than never?

Yeah, I meanwhile that I better understand what's what agree that this as-is doesn't make any sense.

Somewhat related: The underlying problem that I really was after was to "have an object that encapsulates both a Multihash and the Multibase that it was originally expressed in (e.g. to provide it as context in error messages)". In my project, I have now written a MultihashWithMultibase for this purpose. Do you think adding that here could make sense? If yes, I'm happy to raise a PR. If no, I'll close this issue.

@ianopolous @mk868 any thoughts?

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

Successfully merging this pull request may close these issues.

2 participants