Skip to main content

CRC Functions

AMPS includes functions that compute a CRC checksum over a string. This function is useful for creating a numeric identifier from a string representation. This is commonly-used to create a shortened representation of the string, or to provide input for a MOD calculation.

CRC32

CRC32


CRC32(string)

Returns a 32-bit integer calculated as a checksum of the provided string. This function uses CRC32-C to create the result. If a NULL value is provided, this function returns a constant value.

Parameters

  • string: The string to calculate the checksum for.

Returns

A 32-bit integer checksum.

CRC64

CRC64


CRC64(string)

Returns a 64-bit integer calculated as a checksum of the provided string. This function uses a polynomial of 0x95AC9329AC4BC9B5 to create the result. If a NULL value is provided, this function returns a constant value.

Parameters

  • string: The string to calculate the checksum for.

Returns

A 64-bit integer checksum.