def proto_to_bytes(code):
    """
    Converts a protocol code into an unsigned varint.
    """
    return uvarint_encode(code)[0]
def multihash_to_bytes(string):
    """
    Converts a multihash string as an unsigned varint.
    """
    return uvarint_encode(b58decode(string))[0]