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

Streaming multibase decoder #44

Open
lidel opened this issue Aug 11, 2021 · 1 comment
Open

Streaming multibase decoder #44

lidel opened this issue Aug 11, 2021 · 1 comment
Labels
need/triage Needs initial labeling and prioritization

Comments

@lidel
Copy link
Member

lidel commented Aug 11, 2021

Enhancement idea by @gammazero (extracted from ipfs/kubo#8180 (comment)):

Would it be worth implementing a multibase Decoder that would take an io.Reader and return one as well, with a signature like NewDecoder(io.Reader) io.Reader

Then [ipfs multibase decode <file>] could all be done without having to read the entire file into memory.

decReader := mbase.NewDecoder(file)
return resp.emit(decReader)

@lidel Seems like this is something that should exist, or am I missing an obvious reason it does not? Seems like a NewDecode function could start reading the stream, and then construct the correct decoder and return it as an io.Reader.

@lidel lidel added the need/triage Needs initial labeling and prioritization label Aug 11, 2021
@MichaelMure
Copy link

FYI, I have a partial implementation at master...MichaelMure:go-multibase:encode-writer

But then I stumbled on #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants