harukizaemon/hamster — pull request #22 by baconpat (2013-06-25 02:06:09+00:00)
Title: Prevent entry order changing Hash#hash value

The previous implementation of the Hash#hash method was affected by the
order that the key/value pairs were returned from the internal trie's
each method. This meant that two Hashes that appeared identical could
fail an equality check because their hash values could be different.

Sorting the keys before building up the hash value is a simple (and
obvious) way to correct this. There is likely a more efficient or clever
solution to this problem, but in the meantime this patch at least fixes
the bug I have been running into.