Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>checksum()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CHECKSUM()

Syntax:     CHECKSUM(<expC>)

Arguments:  <expC> is the character string for which a check sum is to
            be calculated.

Returns:    A numeric value.
            The figure correspond to the check sum for the <expC>
            string.

Usage:      CHECKSUM() is use to calculate the check sum for a
            string.  This check sum can, for example, be used to
            calculate whether the text has been changed.  The function
            is positional dependent, so that the probability of detecting
            the error will be greater than that of ASCIISUM().

Notes:      The return value corresponds to a 32-bit number.  The check
            sum can not be used for clear coding of data, as the
            calculated sum for two different strings can be the same.
            Foe example, the test sum of "PASTETEN" and "PERSONAL"
            are equal.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * Where ASCIISUM() would produce the same
            * results.
            ? CHECKSUM("abc")                   && Result: 247334
            ? CHECKSUM("cba")                   && Result: 246822

            * However, it is also possible for the same
            * result to be produced from different
            * strings.
            ? CHECKSUM("PASTETEN")              && Result: 530020
            ? CHECKSUM("PERSONAL")              && Result: 530020

            * A null string will result in 0.
            ? CHECKSUM("")                      && Result: 0




See Also: ASCIISUM()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson