tcl::t...::crc32(3tcl)
๐ tcl::transform::crc32 โ the 3tcl manual, bestie edition ๐
Reflected/virtual channel support โจ and yes this is a 3tcl page, we're in Tcl land now, buckle up ๐
โจ NAME โจ
tcl::transform::crc32 โ the Crc32 transformation, aka the girl who watches every byte go by and does math about it ๐งฎ๐
๐ธ SYNOPSIS ๐ธ
package require Tcl 8.6 9
package require tcl::transform::core ?1.1?
package require tcl::transform::crc32 ?1.1?
::tcl::transform::crc32 chan -option value...
the ?1.1? means that version is optional, it's giving "at least this, bestie" ๐ซถ
๐ฆ DESCRIPTION ๐ฆ
okay so the tcl::transform::crc32 package hands you a command that builds a channel transformation. What does it do? It lets the read and written bytes pass straight through unchanged โ literally just like tcl::transform::identity, no cap โ but additionally it's continuously computing the crc32 checksums of the data it has seen, separately for each direction, and it stashes those checksums in Tcl variables that you name at construction time. The checksum in question is zlib's crc32. periodt ๐
The other transformations chilling in this module are tcl::transform::adler32, tcl::transform::counter, tcl::transform::identity, and tcl::transform::observe. Squad goals ๐
And the internal TclOO class doing the actual transform-handler work is a subclass of the tcl::transform::core framework. iconic inheritance moment ๐
๐ API ๐
::tcl::transform::crc32 chan -option value...โ this command creates a crc32 checksumming transformation sitting on top of the channelchan, and it returns the handle for it. The options it accepts are, and I need you to hear me out:-read-variable varnameโ the value of this option is the name of a global or namespaced variable, and that's the location where the transformation has to store the crc32 checksum of the data read from the channel. If you don't specify it, or you set it to the empty string, then the checksum of the read direction justโฆ isn't saved. she's mysterious like that ๐-write-variable varnameโ the value of this option is the name of a global or namespaced variable, the location where the transformation has to store the crc32 checksum of the data written to the channel. If not specified, or the empty string, the checksum of the write direction is not saved either. ๐
๐ BUGS, IDEAS, FEEDBACK ๐
ngl, this document โ and the package it describes โ will undoubtedly contain bugs and other problems. It's giving "we know, we know" ๐ญ. Please report them in the category virtchannel of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. And please also report any ideas for enhancements you have for either the package and/or the documentation, we want them fr fr ๐ซถ
When you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. that's the vibe check, don't skip it โจ
Also note, and this is important: attachments are strongly preferred over inlined patches. You make an attachment 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. click that button bestie ๐
๐ KEYWORDS ๐
channel transformation, checksum, crc32, reflected channel, tip 230, transformation, virtual channel
๐ CATEGORY ๐
Channels
๐ COPYRIGHT ๐
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
lowkey mandatory disclaimer: this whole thing ships as part of tcllib, version 1.1, and the page is tcl::t...::crc32(3tcl) โ that's the manual name, right there in the corner, iykyk ๐
k bye bestie, go checksum something, you ate ๐ โจ๐ฆ
๐ฆ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 ยท Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 ยท Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 ยท Tcl
- Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms