sum (contrast with cksum and md5sum) is a handy little program that calculates a checksum and a block count for every file in its input.

In perfect accordance with traditions, sum enjoyed at least two different incompatible implementations, one in System V and the other in BSD.
In GNU sum --sysv triggers use of the System V algorithm and -r of the BSD algorithm

The FSF says that cksum is better, and it should be used for all new applications.
Notice that sum can be a major portability problem.