From: messju mohr Date: 2003-12-23T02:35:31+09:00 Subject: Re: md5 On Tue, Dec 23, 2003 at 02:21:40AM +0900, KONTRA Gergely wrote: > Hi! > > Is there any efficient way to calculate the md5 hash for a file? > > Reading the entire file isn't memory efficient under winxp (big file...) ;( require 'md5' d = Digest::MD5.new chunk = nil md5 = nil begin while (chunk = STDIN.sysread(4096)) do d.update(chunk) end rescue EOFError md5 = d.to_s end print md5 + "\n" > Gergo