All Products
Search
Document Center

MaxCompute:CRC32

Last Updated:Jul 21, 2023

Calculates the CRC value of a value specified by expr. The value is of the STRING or BINARY type.

Syntax

bigint crc32(string|binary <expr>)

Parameters

expr: required. A value of the STRING or BINARY type.

Return value

A value of the BIGINT type is returned. The return value varies based on the following rules:

  • If the input parameter is set to null, null is returned.

  • If the input parameter is left empty, 0 is returned.

Examples

  • Example 1: Calculate the CRC value of string ABC. Sample statement:

    -- The return value is 2743272264. 
    select crc32('ABC');
  • Example 2: The input parameter is set to null. Sample statement:

    -- The return value is null. 
    select crc32(null);

Related functions

For more information, see Other functions.