MySQL CRC32() Function: Compute a 32-bit checksum

CRC32() calculates a 32-bit unsigned checksum for a string. It is useful for lightweight comparisons, not secure hashing.

CRC32(): Quick SQL Example

Run this SELECT query directly in MySQL or phpMyAdmin. It uses fixed inputs so you can verify the result without creating a table.

SELECT CRC32('MySQL') AS checksum_value;
checksum_value
3259397556
On this page — Show page sectionsHide page sections

More SQL Examples and Explanations

CRC32(expr) computes a cyclic redundancy check and returns a 32-bit unsigned value. The result is NULL when the argument is NULL.

SELECT CRC32('string');
SELECT CRC32('plus2net'); -- Output: 930124482
SELECT CRC32(NULL); -- Output: NULL

Column structure for stored CRC32 values

If you store CRC32 output in MySQL, use an unsigned integer type capable of holding the full 32-bit unsigned range.

PHP crc32()

PHP also provides crc32(). The following example calculates the checksum of the same string.

<?php
echo crc32('plus2net');
?>

On common 64-bit PHP builds the output for this example is 930124482.

How to Interpret the Result

CRC32() is not cryptographic and collisions are possible. Do not use it for passwords or security-sensitive integrity checks.

Common Question

Is CRC32() suitable for storing passwords?
No. Use a dedicated password-hashing algorithm in your application.

↑ Back to top




Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer