I picked up the idea from Terasology's Vector3i here, but used prime numbers instead of powers of two. This should reduce the number of collisions.