Added the hash function

Added the hash function and built the unit test.