tcl::tr...m::crc32(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

tcl::transform::crc32 πŸ’–

okay bestie, welcome to the manual page for the tcl::transform::crc32 command, part of the n section of the Tcllib docs β€” the whole reflected/virtual channel support universe. this one is genuinely so useful, i'm obsessed. πŸ¦‹


NAME ✨

tcl::transform::crc32 β€” the Crc32 transformation, aka the little guy that counts your bytes so you don't have to πŸ’…


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...

DESCRIPTION 🌸

so the tcl::transform::crc32 package gives you a command that makes a channel transformation. what does that do, you ask? it lets the read and written bytes pass through completely unchanged (literally exactly like tcl::transform::identity does, no cap), but β€” and this is the main character part β€” it additionally continuously computes the crc32 checksums of the data it has seen, for each direction, and stores them in Tcl variables that you specify at construction time. 🫢

and which checksum are we talking about exactly? it's zlib's crc32. that one. periodt.

the other related transformations hanging out in this module are tcl::transform::adler32, tcl::transform::counter, tcl::transform::identity, and tcl::transform::observe β€” go give them a vibe check too, they're all iconic in their own way πŸ’œ

one more thing: the internal TclOO class that implements the transform handler is a subclass of the tcl::transform::core framework. it's giving "built on solid foundations" energy. πŸ—οΈβœ¨


API πŸ‘‘

::tcl::transform::crc32 chan -option value...

this command creates a crc32 checksumming transformation sitting on top of the channel chan, and it returns its handle. that's it, that's the whole move. πŸŽ€

the options it accepts are:

  • -read-variable varname β€” the value of this option is the name of a global or namespaced variable, and it'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 pass the empty string, then the checksum of the read direction is not saved. πŸ™ˆ
  • -write-variable varname β€” the value of this option is the name of a global or namespaced variable, and it's the location where the transformation has to store the crc32 checksum of the data written to the channel. if you don't specify it, or you pass the empty string, then the checksum of the write direction is not saved. πŸ’€

BUGS, IDEAS, FEEDBACK 😭

ngl, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems. it's just how docs are, bestie, don't shoot the messenger. πŸ₯²

please report such things in the category virtchannel of the Tcllib Trackers:

http://core.tcl.tk/tcllib/reportlist

also please report any ideas for enhancements you may have for either the package and/or the documentation β€” we want all of it, fr fr. 🫢

when proposing code changes, please provide unified diffs, i.e the output of diff -u. this is not optional, it's the vibe. πŸ’…

and note further that 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. that's the whole procedure, i promise. ✨


KEYWORDS 🌈

channel transformation, checksum, crc32, reflected channel, tip 230, transformation, virtual channel


CATEGORY πŸ¦‹

Channels


Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, bestie!! πŸ’– this was the tcllib docs, version 1.1, for tcl::tr...m::crc32(n) β€” thanks for reading, you ate that, go checksum something. periodt. πŸ‘‘πŸŽ€βœ¨

πŸ“¦ where this page comes from