fix type checker in hash
add some unit tests for hashing