import base64


def base64encode(data):
    """
    Return bytes encoded as base64.
    :param bytes data: Binary data to encode.
    :return: Base64 encoded bytes
    :rtype: str
    """
    return base64.b64encode(data).decode('utf-8')