Re: [PHP] crc check for JPEG file exists

2008-02-27 Thread Daniel Brown
On Wed, Feb 27, 2008 at 1:49 AM, Olav Mørkrid <[EMAIL PROTECTED]> wrote: > hello > > is crc32() an acceptable way of managing whether a JPEG file exists > (in a database or similar collection)? Not really. It won't always properly compare the binary data, and it's also slower than MD5, SHA1

Re: [PHP] crc check for JPEG file exists

2008-02-27 Thread Bojan Tesanovic
Don't use CRC it is not made for purpose you want, you should use some better algo and of course MD5 is much better, though in my company we had collision with md5 but we are working on more than a billion data set. I have tried to use crc32 on some data and it happened to have very high collis

Re: [PHP] crc check for JPEG file exists

2008-02-27 Thread Per Jessen
Olav Mørkrid wrote: > is crc32() an acceptable way of managing whether a JPEG file exists > (in a database or similar collection)? > > i mean doing a crc32() on the binary data of the JPEG file, and then > check the database if there is already another entry with the same > CRC. > > the database

Re: [PHP] crc check for JPEG file exists

2008-02-26 Thread Aleksandar Vojnovic
I would rather use md5_file() for file uniqueness. Aleksander Olav Mřrkrid wrote: hello is crc32() an acceptable way of managing whether a JPEG file exists (in a database or similar collection)? i mean doing a crc32() on the binary data of the JPEG file, and then check the database if there i