The fastest and least resource-intensive algorithm for calculating checksums?

The blocks that need to be hashed is not more than 128 kilobytes. You intend to use the network application to check the integrity of files.
October 8th 19 at 03:59
4 answers
October 8th 19 at 04:01
Solution
CRC32-C (a kind of crc32 with a polynomial 0x82F63B78), he is the fastest on new Intel Ah because the set sse4.2 includes instructions for its hardware support. On other processors it speeds crc32 usual, ie is also very fast.
Well, xor is processors 8086. - Erik_Muller76 commented on October 8th 19 at 04:04
Thank you! Perhaps we should use it. And how on with++ to write code that would use sse4.2 using gcc? - felton.McClu commented on October 8th 19 at 04:07
#include <nmmintrin.h></nmmintrin.h>
- araceli commented on October 8th 19 at 04:10
October 8th 19 at 04:03
view in the direction of the CRC
There is still more rapid, such as Adler-32 and Murmur2. But they are less "standard". Murmur2 is fairly new and its popularity is growing(it is used in Scala, nginx, libstdc++, Hadoop). - Erik_Muller76 commented on October 8th 19 at 04:06
Murmur2 is quite old and it has algorithmic flaws, leading to a 97% probability of collisions at the synthetic tests. Use MurmurHash3, if you need it. Or CRC32, because it was developed for the detection of bit errors. - felton.McClu commented on October 8th 19 at 04:09
October 8th 19 at 04:05
xor
October 8th 19 at 04:07
There is still a lot from the implementation of the algorithm depends, for example, in the hash function built into PHP, the fastest algorithm md5, and crc32 is almost 2 times slower, and the same adler32 4 times slower, although the descriptions in the same wiki should be one of the fastest times as adler32.

Find more questions by tags Hashing