MySQL CRC32 Function

MySQL CRC32 function is one of the Mathematical Functions which computes the cyclic redundancy value. The return value of this CRC32 function is 32 bit unsigned integer. The syntax of the CRC32 in MySQL is as shown below:

SELECT CRC32(expression);

This CRC32 function accepts string expression as an output. If not, it converts the given value into a string.

MySQL CRC32 Function Example 1

The MySQL CRC32 returns the Cylindric Redundancy value of the given value. The following query shows multiple ways to use the CRC32 function.

SELECT CRC32('MySQL');

SELECT CRC32('tutorial gateway');

SELECT CRC32('Hello'), CRC32('Hi'), CRC32('World');
MySQL CRC32 Function 1

MySQL CRC32 Example 2

In this MySQL Mathematical Function example, we are going to find the Cylindric Redundancy value of Last Name and Occupation columns.

SELECT EmpID, 
FirstName,
      LastName,
      CRC32(LastName),
      Occupation,
      CRC32(Occupation),
      YearlyIncome,
      Sales
FROM `MySQL Tutorial`.customer;
MySQL CRC32 Function 2