> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-functions/numeric-functions/crc32.md).

# CRC32

## Syntax

{% tabs %}
{% tab title="Current" %}

```bnf
CRC32([par,]expr)
```

{% endtab %}

{% tab title="< 10.8" %}

```sql
CRC32(expr)
```

{% endtab %}
{% endtabs %}

## Description

Computes a cyclic redundancy check (CRC) value and returns a 32-bit unsigned value. The result is `NULL` if the argument is `NULL`. The argument is expected to be a string and (if possible) is treated as one if it is not.

{% tabs %}
{% tab title="Current" %}
Uses the alternate Castagnoli polynomia.

Often, CRC is computed in pieces. To facilitate this, there's an optional parameter: CRC32('MariaDB')=CRC32(CRC32('Maria'),'DB').
{% endtab %}

{% tab title="< 10.8" %}
Uses the ISO 3309 polynomial that used by zlib and many others.
{% endtab %}
{% endtabs %}

## Examples

{% tabs %}
{% tab title="Current" %}

```sql
SELECT CRC32(CRC32('Maria'),'DB');
+----------------------------+
| CRC32(CRC32('Maria'),'DB') |
+----------------------------+
|                 4227209140 |
+----------------------------+
```

{% endtab %}

{% tab title="< 10.8" %}

```sql
SELECT CRC32('MariaDB');
+------------------+
| CRC32('MariaDB') |
+------------------+
|       4227209140 |
+------------------+

SELECT CRC32('mariadb');
+------------------+
| CRC32('mariadb') |
+------------------+
|       2594253378 |
+------------------+
```

{% endtab %}
{% endtabs %}

## See Also

* [CRC32C()](/docs/server/reference/sql-functions/numeric-functions/crc32c.md)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
