import base64
import json


def encode_additional_data(additional_data):
    """Encodes additional_data object"""
    if isinstance(additional_data, dict):
        return base64.b64encode(json.dumps(additional_data).encode()).decode('utf-8')
    raise ValueError("additional_data must be of type dict")