Helpful Information
 
 
Category: Ruby Programming
Ruby hashing tools

I am wanting to use things like md5 or sha. However there doesn't seem to be any librarys that will allows this. Anyone know of where I can find one at?

From searches on google, people have done:


import md5

sorry Yegg but I was talking about ruby not python.

Ok I figured it out. I found it in one of my books. It doesn't seem to be documented well in english yet.

Use use the Digest Module

so something like:



require "digest/md5"
hash_class = Digest::MD5
puts hash_class.hexdigest("hey")


That works for MD5, RIPEMD-160, SHA1 and SHA2 according to what I read. However I cannot get SHA2 to work right. It loads it right during the requie call however it fails at the Digest::SHA2. I wonder why.

sorry Yegg but I was talking about ruby not python.
I thought I saw an import md5 in some Ruby code I searched. Anyways, the link I originally found was

http://raa.ruby-lang.org/gonzui/markup/md5_crypt/md5_crypt.rb










privacy (GDPR)