Re: md5sum() patch

From: Date: Thu, 15 Nov 2001 20:10:23 +0000
Subject: Re: md5sum() patch
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-70597@lists.php.net to get a copy of this message
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, derick@php.net 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


Thread (23 messages)

« previous php.dev (#70597) next »