Identifier and Checksum
AMPS includes functions that generate identifiers and compute checksums. These functions are useful for creating unique values, creating a shortened representation of a string, or providing input for a MOD calculation.
UUID7
UUID7
UUID7()
Generates a unique identifier (UUID) in the version 7 format specified by RFC 9562.
This function is non-deterministic, and cannot be used in contexts that require a deterministic function.
Parameters
None.
Returns
The identifier is returned as a formatted string.
MD5
MD5
MD5(string)
Returns the MD5 checksum of the provided string.
Parameters
string: The string to checksum.
Returns
The MD5 checksum of the string.
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.