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
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:
Cast
return the number of bytes actually used from the argument sliceRead(io.Reader) Cid
that leaves the input reader positioned at the first byte after the CID consumed