import json
import hashlib


def hash_dict(nested_dict):
    """ Returns hash of nested dict, given that all keys are strings
    """    

    dict_string = json.dumps(nested_dict, sort_keys=True)
    md5_hash = hashlib.md5(dict_string.encode()).hexdigest()

    return md5_hash