On Tue, Dec 11, 2001 at 10:02:57AM -0500, Pete Emerson wrote:
> Is there a faster way to calculate the hex md5 of a file?

Faster in what sense?

In terms of execution speed, probably not.  You could reimplement Digest::MD5
to include a function, written in C, that opens the file, reads it,
calculates the md5 sum, and returns the sum.  You'll probably get a marginal
speed improvement.  The rest of Digest::MD5 is already written in C,
the only thing the aforementioned function saves you is a few method calls.

In terms of code size, no, not if you're going to use the current
Digest::MD5 interface.  You could add a method to Digest::MD5 that does
basically what your md5() function does, but you'd just be moving the code
somewhere else.  It's even possible such a function has been added already;
have you checked the latest version?


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to