import hashlib


def generate_id(config, random):
    """ Generate id for experiment. """
    name = hashlib.md5(config.alias(as_string=True).encode('utf-8')).hexdigest()[:8]
    name += ''.join(str(i) for i in random.integers(10, size=8))
    return name