Crimp

Build Status Gem Version

Creating an md5 hash of a number, string, array, or hash in Ruby

mighty-boosh-four-way-crimp-o

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

  1. Fork it ( http://github.com//crimp/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request