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”
···
On Tue, Dec 23, 2003 at 02:21:40AM +0900, KONTRA Gergely wrote:
Speaking of which, where can I find documentation for the Digest class?
I can’t find it in ruby-doc.org, and there is very little in digest.rb
class to explain how it works.
Thanks,
Carl Youngblood
messju mohr wrote:
···
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”
On Tuesday, December 23, 2003, 7:56:53 AM, Carl wrote:
Speaking of which, where can I find documentation for the Digest class?
I can’t find it in ruby-doc.org, and there is very little in digest.rb
class to explain how it works.
Speaking of which, where can I find documentation for the Digest class?
I can’t find it in ruby-doc.org, and there is very little in digest.rb
class to explain how it works.
there is a ext/digest/digest.txt in the ruby source-distribution.
···
On Tue, Dec 23, 2003 at 05:56:53AM +0900, Carl Youngblood wrote: