import base64


def binary_to_base64(path: str) -> str:
    """
    Transforms a binary file to base64
    :param path: file's path
    :return: base code
    """
    with open(path, 'rb') as binary_file:
        binary_file_data = binary_file.read()
        base64_encoded_data = base64.b64encode(binary_file_data)
        base64_message = base64_encoded_data.decode('utf-8')
        return base64_message