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

Support for reading concatenated CIDs #93

Closed
anorth opened this issue Nov 8, 2019 · 0 comments · Fixed by #95
Closed

Support for reading concatenated CIDs #93

anorth opened this issue Nov 8, 2019 · 0 comments · Fixed by #95

Comments

@anorth
Copy link
Member

anorth commented Nov 8, 2019

CIDs carry a prefix including the length of the multihash payload, so it should be possible to read concatenated CIDs from a stream or buffer without the need for additional metadata or delimiters. Unfortunately the methods available don't expose quite enough information to achieve this.

Some ways this could be fixed:

  • have Cast return the number of bytes actually used from the argument slice
  • add a new Read(io.Reader) Cid that leaves the input reader positioned at the first byte after the CID consumed
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 a pull request may close this issue.

1 participant