svenfuchs/i18n — pull request #285 by evanmiller67 (2014-09-08 19:01:13+00:00)
Title: Allow for the configuration of a cache_key_digest method

This will allow someone to use something other than #hash on an object (which will change per VM startup).
Documented in issues #146 and #52; as well as [here](https://www.ruby-forum.com/topic/560622). Demonstrated here on 2.1.2:
```ruby
$ irb
~> Console extensions: wirble hirb ap rails2 rails3 pm interactive_editor
>> 'foo'.hash
=> -2698411427522052147
>> exit
$ irb
~> Console extensions: wirble hirb ap rails2 rails3 pm interactive_editor
>> 'foo'.hash
=> 3357245547237632663
```
This is especially handy when using something like Redis to cache values which should persist across server restarts and allow for multiple application instances to talk to the same Redis server, or multiple applications sharing the same translation store.

Using something like Digest::MD5 takes double the time as Object#hash. However, the digest value remains consistent for the same raw value across multiple VMs.

I've done some benchmarks using different hashing algorithms and have uploaded the results [here](https://gist.github.com/evanmiller67/4658b1b05c805b4c8ed2).

Props to @yellow5 for his help digging through with me!