import hashlib


def get_key(model_params, mw_range, bins):
    """
    Generate a hash key based on the model parameters used and the fited
    mw_range and number of bins.
    """
    hasher = hashlib.md5()
    hasher.update(bytes(str(model_params), 'ASCII'))
    hasher.update(bytes(str(mw_range), 'ASCII'))
    hasher.update(bytes(str(bins), 'ASCII'))
    key = hasher.hexdigest()
    return key