x.hashValue ^ y.hashValue } let (width, height) = (500, 500) let total = width * height var hashes = Set<Int>() for x in 0..<width { for y in 0..<height { hashes.insert(GridPoint(x: x, y: y).hashValue) } } print("\(hashes.count) unique hashes out of a total of \(total).”) // 1024 unique hashes out of a total of 1_000_000 99.9% of values triggers a hash collision.