test hash function