Nahh I think md5_file() isn't very good. However, overloading md5() doesn't really seem like a good idea either.
md5sum() is pretty appropriate, anybody who is going to use this function is probably going to be familiar with the md5sum program. Plus md5sum() is fewer keystrokes. ;) -Chris -----Original Message----- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 15, 2001 1:10 PM To: Hartmut Holzgraefe Cc: Lenar Lõhmus; [EMAIL PROTECTED] Subject: Re: [PHP-DEV] md5sum() patch On Thu, Nov 15, 2001 at 09:37:22PM +0100, Hartmut Holzgraefe wrote : > Lenar Lõhmus wrote: > > >Alessandro Astarita wrote: > >>Il 17:25, giovedì 15 novembre 2001, [EMAIL PROTECTED] ha scritto: > >>>Then this will do the same: > >>>$sum = `md5sum filename`; > >>> > >>Do I have to depends on the external executable? ...in my opinion is not > >>the right way. > > > >+1 to the function > > hm, what about just overloading the current md5 function? > > if given a string -> current behavior > > if given a file handle resource -> read file and return sum -1 on that (+1 on md5_file() ) You want your code look like $f = fopen('filename'); $md5sum = md5($f); fclose($f); than $m45sum = md5_file($f); ? No seriously I hope ;) - Markus -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]