Created
May 21, 2012 19:12
-
-
Save kyledecot/2764046 to your computer and use it in GitHub Desktop.
Ruby String#to_md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/md5' | |
class String | |
def to_md5 | |
Digest::MD5.hexdigest(self) | |
end | |
end | |
# "Hello World!".to_md5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment