creating hash function of each node.