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