Manually combining hashes is error prone and hard to follow, especially when there are many values. Poor implementations may also introduce performance or security concerns if they are prone to collisions. Delegating to
Array#hash is clearer, faster, and safer.
def hash @foo ^ @bar end
def hash [@foo, @bar].hash end