Caché MultiValue Basic Reference
CHECKSUM


Returns a checksum number for a string.
Synopsis
Arguments
Description
The
CHECKSUM function generates a cyclic redundancy code (also called a checksum) corresponding to
string. It returns this checksum as a positive 5digit integer. A checksum can be used to determine if data has been modified or if it was incompletely transmitted.
CHECKSUM uses an 8bit byte sum mode to calculate the checksum.
CHECKSUM returns the same checksum number for a numeric and the corresponding numeric string. However, numerics are converted to canonical form before checksum processing, whereas numeric strings are not converted to canonical form. Canonical and noncanonical forms of the same number have different checksums.
All string and numeric values, including zero, return a 5digit checksum. However, if
string is a null string a checksum of 0 is returned.
Examples
The following examples all return the same checksum:
PRINT CHECKSUM(123.4)
PRINT CHECKSUM("123.4")
PRINT CHECKSUM(+00123.400)
The following examples
do not return the same checksum:
PRINT CHECKSUM(123.400)
PRINT CHECKSUM("123.400")
See Also


$ZCRC function in ObjectScript