Comments on: How to avoid hash collisions when using MySQL’s CRC32 function https://www.percona.com/blog/how-to-avoid-hash-collisions-when-using-mysqls-crc32-function/ Tue, 13 Feb 2024 17:09:12 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Chuck Mire https://www.percona.com/blog/how-to-avoid-hash-collisions-when-using-mysqls-crc32-function/#comment-10966763 Sat, 06 Aug 2016 23:58:09 +0000 https://www.percona.com/blog/?p=26131#comment-10966763 I wrote a CRC32 program that will calculate the CRC32 value for either a file or a string. My program has a unique feature in that you can use either the normal seed value of EDB88320 Hex to compute the CRC32 value AND/OR you can use any other seed you want. IF you have a hash collision with the normal seed value, you will NOT have a hash collision on that same file or string when a different seed is used. So just keep track of more than one CRC32 value using a different seed.

My original DOS version as well as a standalone Windows executable (with source code) is available here:

http://qb45.org/files.php?action=search2&keywords=crc32&funcbtn=Search%21

]]>
By: Matthew Boehm https://www.percona.com/blog/how-to-avoid-hash-collisions-when-using-mysqls-crc32-function/#comment-9331170 Tue, 14 Oct 2014 16:20:45 +0000 https://www.percona.com/blog/?p=26131#comment-9331170 “Both of these are distributed with Maatkit.”

In fact, all 3 (FNV1A, FNV_64, MURMUR_HASH) are distributed with Percona Server. Most people just don’t bother installing them even though it is recommended as a post-install step when installing via yum.

Also, pt-table-checksum doesn’t detect and prefer the other functions. It searches for them in this order: CRC32 FNV1A_64 FNV_64 MURMUR_HASH MD5 SHA1 and uses the first one it finds. So, unfortunately, even if you have the others installed, unless you specify one, pt-t-c will always use CRC32. I submitted a bug/FR on this a while back (2012!) (https://bugs.launchpad.net/percona-toolkit/+bug/1059732) and was overrulled on changing the preference.

]]>