Helpful traits, types, and functions for constructing multiformat types.
The BaseEncoded
"smart pointer" wraps any multiformat type that implements
the EncodingInfo
trait also found in this crate. BaseEncoding
automatically
handles base encoding the inner value using the Multibase text
encoding systems.
The CodecInfo
trait allows a multiformat type to expose its
[Multicodec][MULTICODEC] value to code that relies on this trait.
This is an implementation of a variable length, unsigned integer that is common to all multiformat protocols and types.
This is the combination of a Varuint
followed by a binary octet array of
equal length. This is a common way to encode arbitrary binary data so that any
code can skip over the data if it doesn't know how, nor want, to process it
<varbytes> ::= <varuint> N(OCTET)
^ ^
/ \
count of variable number
octets of octets