SYSV checksum


The SYSV checksum algorithm is a commonly used, legacy checksum algorithm.
It has been implemented in UNIX System V and is also available through the GNU sum command line utility.

Newer checksum algorithms

The manual page of the GNU sum utility program states:
"sum is provided for compatibility; the cksum program is preferable in new applications."

Description of the algorithm

The main part of this algorithm is simply adding up all bytes in a 32-bit sum. As a result, this algorithm has the characteristics of a simple sum:
As a result, many common changes to text data are not detected by this method.
The last two lines of the algorithm reduce the total sum to a 16-bit number.