Vector3.up and Vector3.down return same HashCode

I was trying to “map” vertices of a model that is split into multiple meshes I’m generating in code, and decided to use a Dictionary with vertex’s position HashCode as a key to group up all the vertices that share position. Everything worked perfectly with one exception: vertices on both poles, at Vector3.up and Vector3.down, ended up having the same HashCode of -33554432.
Am I doing something wrong or this is a quirk of Vector3.GetHashCode implementation? Is there anything that can be done other than checking if vertex at Vector3.Up each time GetHashCode is called?

This is normal behavior. There is no guarantee that 2 unique values will produce 2 unique hash codes. Vector3.up and Vector3.down returning the same hash code is perfectly valid. Your dictionary should use the Vector3’s as keys, not their hash codes (internally, the dictionary uses hash codes to optimize lookups).

MSDN provides a useful overview of hash codes in C#: