|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
||||
|
||||
|
From searches on google, people have done:
Code:
import md5 Last edited by †Yegg† : January 20th, 2006 at 05:28 PM. |
|
#3
|
|||
|
|||
|
sorry Yegg but I was talking about ruby not python.
|
|
#4
|
|||
|
|||
|
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: Code:
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. |
|
#5
|
||||
|
||||
|
Quote:
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/mar...pt/md5_crypt.rb |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Ruby Programming > Ruby hashing tools |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|