import json
import hashlib


def compute_caching_hash(d):
    """Generate a hash from a dictionary to use as a cache file name
    
    This is intended to be used for experiments cache files
    """
    string = json.dumps(d, sort_keys=True, ensure_ascii=True)
    h = hashlib.sha1()
    h.update(string.encode('utf8'))
    return h.hexdigest()