From: Chris Shea Date: 2007-03-30T12:45:09+09:00 Subject: Re: How to md5 a string? On Mar 29, 9:13 pm, Bontina Chen wrote: > I'm using hexdigest in Digest/MD5 but got totally different outputs from > other tools. > I got some clues that in windows I should read the source I would like > to hash with binary mode. > But I have no idea how to transform a string to binary mode. > Anyone could give my some suggestion? > > Thx > > ABon > > -- > Posted viahttp://www.ruby-forum.com/. It might be informative to see some examples what you're getting with Digest/MD5 vs other tools. I've used Digest/MD5 with great success on Windows. If what you're doing is getting the MD5 of a file, opening it for reading in binary mode is done like so: File.new('filename','rb') Chris