Hash is an irreversible function which generate unique value for each input. But same generate for the same input will be same. So, hash plays major role in the security i.e storing the passwords or any other keys. Even though the hash is irreversible, it can be used to compare the same. The output will be same if you generate hash for any times.