def METHOD_NAME(
    v: Union[str, bytes], alphabet: bytes = BITCOIN_ALPHABET
) -> bytes:
    """
    Encode a string using Base58
    """
    v = scrub_input(v)
    origlen = len(v)
    v = v.lstrip(b'\0')
    newlen = len(v)
    acc = int.from_bytes(v, byteorder='big')  # first byte is most significant
    result = b58encode_int(acc, default_one=False, alphabet=alphabet)
    return alphabet[0:1] * (origlen - newlen) + result