The cksum(1) command calculates a 32 bit checksum of the input data using a POSIX standard algorithm and so should give the same result across multiple platforms (unlike the sum command). The Tcllib version uses the same algorithm and has been checked against the GNU and BSD cksum(1) commands.
More information about the unix command can be found at http://www.tac.eu.org/cgi-bin/man-cgi?cksum+1 or by referring to your system manual page.
% package require cksum 1.0 % crc::cksum "Hello, World!" 2609532967 % crc::cksum -file cksum.tcl 871033703 % exec cksum cksum.tcl 871033703 6652 cksum.tcl %
See the code at http://core.tcl.tk/tcllib/modules/crc/cksum.tcl