Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's wrong with CRC32
Message
De
08/01/2014 13:45:33
 
 
À
08/01/2014 13:33:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01591437
Message ID:
01591523
Vues:
24
>>Then either
>>(1) Always overwrite, or
>>(2) Assume the original ones had a zero checksum. The next one you receive calculate the checksum, it will be different, hence store the new checksum, resize, store the resized image
>>
>>So an identical image will only be replaced the first time
>>
>>Looks like an easy transition from the old system to the new one
>
>Yes, this is what we are doing. We can only have it from the date we migrated and then on.
>
>It just surprised me that so many people recommended to use CRC32 when from OS to OS, this may change because the file size of a file might not be stored the same way when changing OS.

The 4 bytes of the CRC will probably be all right

But this has nothing to do with the OS. Other hashing methods (MD5, SHA-*) should all calculate the same independent of OS
You could even use a block cipher and only store the last block as the hash

To calculate a hash you have to read the whole file. Whether that file contains sparse storage or not has no influence. The file size will be the same but the number of bytes stored on disk (depending on sparse or not) may differ

>
>The only way I could see a good usage of CRC32 is to detect something immediate but not to store it on a permanent basis so to rely on it for months and years to come.
>
>For now, while we have kept the storage of the CRC32, we have changed the detection of similar files by checking the file name as this is something that the incoming source is controlling and there shouldn't be two files with the same names representing the same content.
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform