Whatâ€™s the best (fast, yet with relatively few cases when equal hashes
are generated for non-eql objects) way to implement a hash method?
Is XOR-ing the hashes of an objectâ€™s instance variables (assuming that
two objects are eql if their ivars are eql) a good general approach?
Iâ€™m asking because I use this pattern in my code, and it seems quite
fast; I needed to work around a bug in MRIâ€™s Set#hash and this solutionÂ¹
seems about as fast as the original MRIâ€™s Set#hash. Iâ€™m just not sure
whether itâ€™s hashy enough (so to speak) in that two un-eql objects
hashed in this way produce different hashes often enough.