From: Austin Ziegler Date: 2006-12-06T06:59:32+09:00 Subject: Re: md5 function in Ruby On 12/5/06, 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*** File.read is a bad choice on Windows. It should be avoided if at all possible. Do this instead: puts Digets::MD5.hexdigest(File.open("C:\\dc.log", "rb") { |f| f.read }) -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca