Re: Which hashing algorithm is best to check file duplicity?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 15, 2009 at 10:25:11PM +0100, Martin Zvarík wrote:

> I want to store the file's hash to the database, so I can check next
> time to see if that file was already uploaded (even if it was renamed).
>
> What would be the best (= fastest + small chance of collision) algorithm
> in this case?
>
> Is crc32 a good choice?
>
> Thank you in advance,
> Martin

According to wikipedia, a CRC is not sufficient to detect intentional
alteration of a file/message, since it's relatively easy to design a
message/file which will have the same CRC. On the other hand, CRC, by
design will reliably detect subtle changes to a message/file.

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux