0

How can I generate MD5 hash of a String in JRuby?

String = 'device S6'
Christian MICHON
  • 2,140
  • 2
  • 19
  • 30
Zaf
  • 3
  • 7
  • You don't `need` lots of `backticks` to surround every `possibly` programming-related `term`. – Nic Jun 16 '15 at 14:05
  • possible duplicate of [Creating an md5 hash of a number, string, array, or hash in Ruby](http://stackoverflow.com/questions/6461812/creating-an-md5-hash-of-a-number-string-array-or-hash-in-ruby) – Nic Jun 16 '15 at 14:05

1 Answers1

2

This is a quick jirb session:

>> require 'digest/md5'
=> true
>> md5 = Digest::MD5.new
=> #<Digest::MD5: d41d8cd98f00b204e9800998ecf8427e>
>> md5.hexdigest 'device S6'
=> "0bdf995668120bcb78bfb125995d54e1"

This should get you going...

Christian MICHON
  • 2,140
  • 2
  • 19
  • 30