Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's wrong with CRC32
Message
De
08/01/2014 14:42:22
 
 
À
08/01/2014 13:52:14
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:
01591530
Vues:
41
This message has been marked as a message which has helped to the initial question of the thread.
>>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
>
>They are all ok. But, since I based my CRC32 calculation based on the file size, where the file size is not different because we moved to a new OS, this is why I have this issue. So, assuming no matter the method I would have taken, it would have given a new value in the new OS.

The CRC, or any hash or encryption should be done on the file contents - not the size


>
>>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
>
>That is interesting. Because, in that case, CRC32 would be affected. The hash wouldn't. Thanks for the info

No. A CRC is just another hash



>
>In your experience, if calculating a hash longer to execute than a CRC32? If yes, does this increase based on the file size?


A CRC is a hash. Since the whole file has to be read in order to calculate the hash, the longer the file the longer it takes the calculate the hash

Note that the time is not that significant. I can encrypt ( Rijndael) at speeds of 25 to 35 MB/sec. And this is a block cipher with multiple rounds per block (10, 12 or 14) and lookup tables
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform