Multihash uses protobuf varints to encode both the multicodec and the hash length. This doesn't matter for codec < 0x80 and lengths < 128 bytes. However, this library should still either assert that (and refuse to operate over other codecs/lengths) or encode these numbers.
Multihash uses protobuf varints to encode both the multicodec and the hash length. This doesn't matter for codec < 0x80 and lengths < 128 bytes. However, this library should still either assert that (and refuse to operate over other codecs/lengths) or encode these numbers.
I can't vouch for this library but the varint implementation looks correct at first glance: https://github.com/fmoo/python-varint