Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how calculate md4 hash?

70 views
Skip to first unread message

dave

unread,
May 20, 2005, 3:44:00 PM5/20/05
to

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.

WATANABE Hirofumi

unread,
May 23, 2005, 10:52:57 AM5/23/05
to
Hi,

dave <dav...@email.it> 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


dave

unread,
May 23, 2005, 11:13:54 AM5/23/05
to

> % 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))}|"

0 new messages