_________________________________________________________________
::crc::sum - calculate a sum(1) compatible checksum
package require Tcl 8.2
package require sum ?1.0?
::crc::sum ?-format string? -file filename | string _________________________________________________________________
This package provides a Tcl-only implementation of the sum(1) command which calculates a 16 bit checksum value from the input data. The BSD sum algorithm is used by default but the SysV algorithm is also available.
::crc::sum ?-format string? -file filename | string The command takes string data or a file name and returns a checksum value calculated using the sum(1) algorithm. The result is formatted using the format(n) specifier provided or as an unsigned integer (%u) by default.
-filename name
Return a checksum for the file contents instead of
for parameter data.
% crc::sum «Hello, World!"
37287
% crc::sum -format 0x%X «Hello, World!" 0x91A7
% crc::sum -file cksum.tcl
13392
Pat Thoyts
sum, cksum, checksum, crc, crc32, cyclic redundancy check, data integrity, security