Update hashing algorithm to avoid collisions