Table of Contents

_________________________________________________________________

Name

::crc::cksum - calculate a cksum(1) compatible checksum

Synopsis

package require Tcl 8.2

package require cksum ?1.0?

::crc::cksum ?-format string? message

::crc::cksum ?-format string? -filename file

_________________________________________________________________

Description

This package provides a Tcl-only implementation of the cksum(1) algorithm based upon information provided at in the GNU implementation of this program as part of the GNU Textutils 2.0 package.

Commands

::crc::cksum ?-format string? message

::crc::cksum ?-format string? -filename file The command takes string data or a file name and returns a checksum value calculated using the cksum(1) algorithm. The result is formatted using the format(n) specifier provided or as an unsigned integer (%u) by default.

Options

-filename name
Return a checksum for the file contents instead of for parameter data.

-format string
Return the checksum using an alternative format template.

Examples

% crc::cksum «Hello, World!"
2609532967

% crc::cksum -format 0x%X «Hello, World!" 0x9B8A5027

% crc::cksum -file cksum.tcl
1828321145

See Also

sum(n) , crc32(n)

Authors

Pat Thoyts

Keywords

cksum, checksum, crc, crc32, cyclic redundancy check, data integrity, security


Table of Contents