#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25

    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. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    From searches on google, people have done:

    Code:
    import md5
    Last edited by †Yegg†; January 20th, 2006 at 06:28 PM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    sorry Yegg but I was talking about ruby not python.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    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.
  8. #5
  9. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    Originally Posted by CyBerHigh
    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/mark...t/md5_crypt.rb

IMN logo majestic logo threadwatch logo seochat tools logo