Simple hash function for hashmap