tcl::transform::rot(n)

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

πŸ’– NAME πŸ’–

tcl::transform::rot β€” rot-encryption, bestie. that's it, that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

package require Tcl 8.6 9

package require tcl::transform::core ?1.1?

package require tcl::transform::rot ?1.1?

::tcl::transform::rot chan key

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the tcl::transform::rot package hands you a command that creates a channel transformation. what does that even do?? it does primitive encryption when you're writing, and decryption when you're reading, and it only touches the alphabetic characters. the algorithm is the Caesar-cipher β€” and the specific variant of it that everyone knows and loves is rot13. slay πŸ’…

a related transformation hanging out in this same module is tcl::transform::otp (go look at that one too, iykyk).

ngl the internals are kinda iconic: the TclOO class doing the actual transform-handler work is a subclass of the tcl::transform::core framework. main character inheritance energy fr fr πŸ‘‘


🌈 API 🌈

  • ::tcl::transform::rot chan key β€” this command creates a rot encryption transformation stacked on top of the channel chan, and it gives you back its handle. that's your new baby 🫢

the key tells it how far characters get rotated around the alphabet, and it gets wrapped into the range 0...25.

heads up bestie: this transformation only touches bytes in the ranges ASCII 65...90 and 97...122 β€” that's the upper-case and lower-case alphabetic characters, aka A...Z and a...z. every other byte passes straight through, completely unchanged. no notes. πŸ’€

😭 BUGS, IDEAS, FEEDBACK 😭

not to be dramatic but this document and the package it describes will undoubtedly contain bugs and other problems. it's giving "we're all just doing our best." please report them in the category virtchannel of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. and please, please also report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas here 🧚

when you're proposing code changes, provide unified diffs, i.e the output of diff -u. periodt.

also note: attachments are strongly preferred over inlined patches. to make an attachment, go to the Edit form of the ticket immediately after its creation, and then use the left-most button in the secondary navigation bar. that's the whole trick ✨


πŸ’œ KEYWORDS πŸ’œ

caesar cipher, channel transformation, cipher, decryption, encryption, reflected channel, rot, rot13, tip 230, transformation, virtual channel


πŸ“ CATEGORY πŸ“

Channels


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


and that's a wrap bestie πŸ’– this whole page is from tcllib, version 1.1 β€” go forth and rotate ur alphabet, no cap πŸŒΈπŸ¦‹β­

πŸ“¦ where this page comes from