# CRC32

## Syntax

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

```sql
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()](https://mariadb.com/docs/server/reference/sql-functions/numeric-functions/crc32c)

<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" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/numeric-functions/crc32.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
