Calculates the CRC-32 checksum of a STRING or BINARY value and returns the result as a BIGINT.
Syntax
bigint crc32(string|binary <expr>)Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
expr | Yes | STRING or BINARY | The value to compute the CRC-32 checksum for. |
Return value
Returns a BIGINT. The return value depends on the input:
If
expris null, null is returned.If
expris an empty string,0is returned.
Examples
Calculate the CRC-32 checksum of the string ABC:
-- Returns 2743272264.
select crc32('ABC');Pass null as the input:
-- Returns null.
select crc32(null);Related functions
For related functions, see Other functions.
该文章对您有帮助吗?