Crimp
Creating an md5 hash of a number, string, array, or hash in Ruby
Shamelessly copied from this Stack Overflow answer.
Installation
Add this line to your application's Gemfile:
gem 'crimp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install crimp
Usage
require 'crimp'
Crimp.stringify({:a => {:b => 'b', :c => 'c'}, :d => 'd'})
# => [\"aSymbol=>[\\\"bSymbol=>b\\\", \\\"cSymbol=>c\\\"]Array\",\"dSymbol=>d\"]Array"
Crimp.signature({:a => {:b => 'b', :c => 'c'}, :d => 'd'})
# => "68d07febc4f47f56fa6ef5de063a77b1"
Contributing
- Fork it ( http://github.com/
/crimp/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request