Add hash function for determining hash for a given object.