From: Bontina Chen Date: 2007-03-30T12:09:19+09:00 Subject: Re: md5 function in Ruby Clifford Heath wrote: > Denys Yakhnenko wrote: >> md5=Digest::MD5.hexdigest(File.read("C:\\dc.log")) >> produces completely different hash than any of the other tools I use > > Open the file in binary mode: > > ruby -e 'require "digest/md5"; p > Digest::MD5.hexdigest(File.read("C:\\dc.log", "rb"))' > > Clifford Heath. I'm transforming a string. How could I change a string to binary mode? Thanks Abon -- Posted via http://www.ruby-forum.com/.