Generate MD5 Hash of String in JRuby

1.5k views Asked by At

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

String = 'device S6'
1

There are 1 answers

0
Christian MICHON On

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...