On MRI 1.8, the ordering of the Hash keys are not guaranteed so the result of this function may differ given the same input hash.  Is this acceptable?  (I'm OK with it, but it may be surprising behavior).