brianmario/yajl-ruby — pull request #136 by NZKoz (2014-05-22 03:35:49+00:00)
Title: Add a :sort_keys option to Encoder

This allows people to canonicalize JSON and ensure documents are identical irrespective of the order
keys were added to the underlying Hash. This was covered previously in #7 but in the intervening time `Symbol#<=>` has shipped so I figured I'd see how hard it was to hack in.

This is mostly provided as a "sounding board" to see if the feature is useful to anyone else, rather than something actually ready for inclusion.. The sorting is pretty hackish as is, it should probably intern then sort rather than sort then intern etc.