require 'digest/md5'

Digest::MD5.hexdigest('foobar')