Re: [fastCache] Answers...
| From: | John Lim | Date: | Tue, 23 Jul 2002 12:22:24 +0000 |
| Subject: | Re: [fastCache] Answers... | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7911@lists.php.net to get a copy of this message | ||
Hi
Just using a length check should be sufficient. crc32 and such is for lossy
networks.
Hard disk write failures are rare. Just writing a signature such
as 'fast' at the end to ensure that no data truncation occured.
Eg.
[ file length] [ cache data ] [signature = 'fast_signature']
In my implementation of caching, i skipped the file length but if you are
using NFS
I guess it is safer.
Regards, John
"Pierre-Alain Joye" <paj@pearfr.org> wrote in message
news:20020723113731.38ef83e1.paj@pearfr.org...
> On 23 Jul 2002 11:21:16 +0200
> MARTY Fabien <fabien.marty@free.fr> wrote:
>
> > (Peter)
> > > May I suggest a crc32() instead of md5()? It's between 3 and 10 times
> > > faster, and there have been no duplicate values in a test to 1000000
items
> > > (Source: Binarycloud-dev mailing list, originally from Smarty-dev).
> >
> > What about a choice between the two ?
>
> I m not sure about the ratio :), but that s sure crc32 is faster, and
under certain conditions effectivly 10 times faster (dunno why :)).
>
> And, crc32 is naturally the function to check data integrity.
>
> +1 for crc :)
>
> pa