hash.rb: not require sort in ruby >=1.9