CT_CHECKSUM

 CHECKSUM()
 Calculates the checksum for a character string (algorithm)
------------------------------------------------------------------------------
 Syntax

     CHECKSUM(<cString>) --> nCheckSum

 Argument

     <cString>  Designates the character string for which the checksum is
     computed.

 Returns

     The number returned is the checksum for the <cString>.

 Description

     CHECKSUM() calculates the checksum for a character string.  This
     checksum can determine if a character string has been changed, or
     transmitted or typed incorrectly.  CHECKSUM() is position dependent, so
     the likelihood of error recognition is greater than with ASCIISUM().

 Notes

     .  The return value is a 32-bit whole number.

     .  The checksum cannot be used for definitive coding of data
        because the calculated sum for two different character strings could
        be the same.  For example, the checksum for "PASTETEN" and "PERSONAL"
        are identical.

     .  If character strings have different lengths, the strings
        cannot have identical values.

 Examples

     .  In this example, ASCIISUM() would have returned identical
        results:

        ? CHECKSUM("abc")               // Result: 247334
        ? CHECKSUM("cba")               // Result: 246822

     .  Different character strings of identical length can produce
        identical results:

        ? CHECKSUM("PASTETEN")          // Result: 530020
        ? CHECKSUM("PERSONAL")          // Result: 530020

     .  A null string returns a result of 0:

        ? CHECKSUM("")                  // Result: 0

See Also: ASCIISUM()

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.