tcl::t...::crc32(3tcl)

๐Ÿ“ฆ
version 2.0 ยท 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– 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 channel chan, 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 (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