def hash_dict(d):
    """
    Sorts the dict's keys, then returns the dict in a standardized string form
    """
    keys = sorted(list(d.keys()))
    if len(keys)==0: return "{}"
    s = "{"
    for k in keys[:-1]:
        s += "%s: %s, "%(repr(k), repr(d[k]))
    k = keys[-1]
    s += "%s: %s}"%(repr(k), repr(d[k]))
    return s