Hash test and hash functions