w3resource

MySQL CRC32() function

CRC32() function

MySQL CRC32() returns the cyclic redundancy check value of a given string as a 32-bit unsigned value.

When the argument is NULL the result is NULL.

This function is available as of version 4.1 of MySQL.

Syntax:

CRC32(expression);

Argument

Name Description
expression A string whose CRC32 value is to be retrieved.

Syntax Diagram:

MySQL CRC32() Function - Syntax Diagram

MySQL Version: 5.6


Example of MySQL CRC32() function

Code :

SELECT CRC32('string');

Explanation

The above MySQL statement will return the given string’s cyclic redundancy check value as a 32-bit unsigned value.

Sample Output:

mysql> SELECT CRC32('string'); 
+-----------------+
| CRC32('string') |
+-----------------+
|      2663297705 | 
+-----------------+
1 row in set (0.01 sec)

All Mathematical Functions

MySQL Mathematical Functions, slide presentation

Previous: COT()
Next: DEGREES()



Inviting useful, relevant, well-written and unique guest posts