how calculate md4 hash?

Discussion in 'Ruby' started by dave, May 20, 2005.

  1. dave

    dave Guest

    i would calculate an md4 hash in ruby.
    i've found 'openssl' lib, but i have not any code sample.

    :(


    --
    >here are more things in heaven and earth,

    horatio, than are dreamt of in your philosophy.
     
    dave, May 20, 2005
    #1
    1. Advertising

  2. Hi,

    dave <> writes:

    > i would calculate an md4 hash in ruby.
    > i've found 'openssl' lib, but i have not any code sample.


    % ruby -ropenssl -e 'puts OpenSSL::Digest::MD4.hexdigest("foo")'
    0ac6700c491d70fb8650940b1ca1e4b2
    % echo -n foo | openssl dgst -md4
    0ac6700c491d70fb8650940b1ca1e4b2

    --
    eban
     
    WATANABE Hirofumi, May 23, 2005
    #2
    1. Advertising

  3. dave

    dave Guest


    > % ruby -ropenssl -e 'puts OpenSSL::Digest::MD4.hexdigest("foo")'
    > 0ac6700c491d70fb8650940b1ca1e4b2


    tnx.

    i needed it to calculate ed2k links from console.

    ---
    require 'openssl'

    $*.each{|f|
    puts "ed2k://|file|#{File.basename(f)}|#{File.size(f)}|
    #{OpenSSL::Digest::MD4.hexdigest(File.read(f))}|"
    }



    --
    >here are more things in heaven and earth,

    horatio, than are dreamt of in your philosophy.
     
    dave, May 23, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. LaundroMat

    Calculate sha1 hash of a binary file

    LaundroMat, Aug 6, 2008, in forum: Python
    Replies:
    7
    Views:
    868
    LaundroMat
    Aug 7, 2008
  2. Chris Berrington

    MD4 class in VB.Net

    Chris Berrington, Jul 29, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    281
    Chris Berrington
    Jul 29, 2004
  3. rp
    Replies:
    1
    Views:
    597
    red floyd
    Nov 10, 2011
  4. Dirk Einecke

    Calculate the md5 hash of a string

    Dirk Einecke, Feb 27, 2004, in forum: Ruby
    Replies:
    6
    Views:
    199
    Gavin Sinclair
    Feb 28, 2004
  5. Srijayanth Sridhar
    Replies:
    19
    Views:
    677
    David A. Black
    Jul 2, 2008
Loading...

Share This Page