Tcl Library Source Code

Documentation
Login


[ 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.5 9
package require crc16 ?1.1.5?

::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
::crc::kermit ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::kermit ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::modbus ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::modbus ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::mcrf4xx ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::mcrf4xx ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::genibus ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::genibus ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::crc-x25 ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::crc-x25 ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::crc-sdlc ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::crc-sdlc ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::crc-usb ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::crc-usb ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::buypass ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::buypass ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::umts ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::umts ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::gsm ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::gsm ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::unknown2 ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::unknown2 ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::maxim ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::maxim ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::unknown3 ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::unknown3 ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::unknown4 ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::unknown4 ?-format format? ?-seed value? ?-implementation procname? -filename file
::crc::cms ?-format format? ?-seed value? ?-implementation procname? -- message
::crc::cms ?-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