import json
import hashlib


def get_hash(d):
    """Calculates hash from given dictionary `d`.

    :param d: Dictionary from which hash will be calculated.
    :type d: dict
    :return: Hexadecimal hash string.
    :rtype: str
    """
    json_str = json.dumps(d, sort_keys=True).encode('utf-8')

    return hashlib.md5(json_str).hexdigest()