import base64


def base64bytes(bs, encoding: str = 'utf-8', encerrors='strict') -> str:
    """base64 encode a byte[]
    bs: the byte[] to be encoded
    encoding: default is 'utf-8'
    return: the result str"""
    enc = encoding
    if enc is None or enc == '':
        enc = 'utf-8'
    bsOut = base64.b64encode(bs)
    res = str(bsOut, enc, encerrors)
    return res