Tcl Library Source Code

Documentation
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

crc16 - Perform a 16bit Cyclic Redundancy Check

Table Of Contents

SYNOPSIS

package require Tcl 8.2
package require crc16 ?1.1.3?

::crc::crc16 ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::crc16 ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::crc-ccitt ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::crc-ccitt ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::xmodem ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::xmodem ?-format format? ?-seed value? ?-implementation procname? -filename file

DESCRIPTION

This package provides a Tcl-only implementation of the CRC algorithms based upon information provided at http://www.microconsultants.com/tips/crc/crc.txt There are a number of permutations available for calculating CRC checksums and this package can handle all of them. Defaults are set up for the most common cases.

COMMANDS

OPTIONS

EXAMPLES

% crc::crc16 -- "Hello, World!"
64077

% crc::crc-ccitt -- "Hello, World!"
26586

% crc::crc16 -format 0x%X -- "Hello, World!"
0xFA4D

% crc::crc16 -file crc16.tcl
51675

AUTHORS

Pat Thoyts

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category crc of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.

SEE ALSO

cksum(n), crc32(n), sum(n)

KEYWORDS

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

CATEGORY

Hashes, checksums, and encryption

COPYRIGHT

Copyright © 2002, 2017, Pat Thoyts