import base64


def read_encoded(filename: str) -> str:
    """Read a file and return the base64 encoding of its contents."""
    with open(filename, 'rb') as infile:
        return base64.b64encode(infile.read()).decode('utf-8')