Streaming multibase decoder
Enhancement idea by @gammazero (extracted from https://github.com/ipfs/go-ipfs/pull/8180#discussion_r671549022):
Would it be worth implementing a multibase Decoder that would take an
io.Readerand return one as well, with a signature likeNewDecoder(io.Reader) io.ReaderThen [
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
NewDecodefunction could start reading the stream, and then construct the correct decoder and return it as anio.Reader.
FYI, I have a partial implementation at https://github.com/multiformats/go-multibase/compare/master...MichaelMure:go-multibase:encode-writer
But then I stumbled on https://github.com/multiformats/go-multibase/issues/62