Add hash function.