Easy MD5/SHA1 Hashes in RubyMotion
I've seen a lot of people using CocoaPods to hash strings in RubyMotion. While this seemingly works (I wasn't able to get it to), there's an easier way.
A gem was released called 'RmDigest' which allows you to easily throw this functionality into your app. (In the background, it's actually utilizing the same Obj-C library.)
Gemfile:
gem 'rm-digest'
Rakefile:
require 'rm-digest'
Usage:
sha1 = RmDigest::SHA1.hexdigest('foo')
md5 = RmDigest::MD5.hexdigest('bar')
Written by Tom Milewski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#