_________________________________________________________________
::crc::crc32 - Perform a 32bit Cyclic Redundancy Check
package require Tcl 8.2
package require crc32 ?1.0?
::crc::crc32 ?-format string? ?-seed value? ?-implementa_tion procname? message
::crc::crc32 ?-format string? ?-seed value? ?-implementa_tion procname? -filename file
_________________________________________________________________
This package provides a Tcl-only implementation of the CRC-32 algorithm based upon information provided at http://www.naaccr.org/standard/crc32/document.html If the Trf package is available then the crc-zlib command is used to perform the calculation.
::crc::crc32 ?-format string? ?-seed value? ?-implementation procname? message
::crc::crc32 ?-format string? ?-seed value? ?-implementation procname? -filename file The command takes string data or a file name and returns a checksum value calculated using the CRC-32 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.
Note that as the Trf crc-zlib cannot accept a seed value, use of this option will force the use of the Tcl only implementation.
% crc::crc32 «Hello, World!"
3964322768
% crc::crc32 -format 0x%X «Hello, World!" 0xEC4AC3D0
% crc::crc32 -file crc32.tcl
483919716
Wayland Augur, Pat Thoyts
cksum, checksum, crc, crc32, cyclic redundancy check, data integrity, security