From: ara.t.howard@... Date: 2006-12-06T07:04:22+09:00 Subject: Re: md5 function in Ruby On Wed, 6 Dec 2006, Denys Yakhnenko wrote: > Hello all: > > I've been having trouble with Ruby's md5 function... The following code > snippet (file attached): > > ***begin code*** > require 'digest/md5' > > md5=Digest::MD5.hexdigest(File.read("C:\\dc.log")) > puts md5 > ***end code*** > > produces completely different hash than any of the other tools I use > (MD5Win32 or winMD5Sum)... Am I not using the function correctly? Wtf is > being hashed? maybe only part of your data ?? try require 'digest/md5' buf = open("C:\\dc.log","rb"){|f| f.read} md5 = Digest::MD5.hexdiges buf puts md5 -a -- if you want others to be happy, practice compassion. if you want to be happy, practice compassion. -- the dalai lama