def _binary_cid_from_str(cid: str) -> Tuple[(bytes, Multibase)]:
    if ((len(cid) == 46) and cid.startswith('Qm')):
        return (base58btc.decode(cid), multibase.get('base58btc'))
    (mb, b) = multibase.decode_raw(cid)
    if (b[0] == 18):
        raise ValueError('CIDv0 may not be multibase encoded (found multibase encoded bytes starting with 0x12).')
    return (b, mb)
def _binary_cid_from_str(cid: str) -> Tuple[(bytes, Multibase)]:
    if ((len(cid) == 46) and cid.startswith('Qm')):
        return (base58btc.decode(cid), multibase.get('base58btc'))
    (mb, b) = multibase.decode_raw(cid)
    if (b[0] == 18):
        raise ValueError('CIDv0 may not be multibase encoded (found multibase encoded bytes starting with 0x12).')
    return (b, mb)