base32::core(3tcl)
π base32::core β the vibe β¨
okay so bestie, you found the base32::core page (that's the 3tcl manual, in case the header at the top wasn't giving it away π«Ά). it's the little engine room of base32 encoding, and yes we're gonna read the whole thing together. no skimming, no cap.
πΈ NAME πΈ
base32::core β Expanding basic base32 maps. that's the whole personality. she expands maps. slay.
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require base32::core ?0.2?
::base32::core::define map forwvar backwvar ivar
::base32::core::valid string pattern mvar
look at her. four lines. iconic behaviour. π
π¦ DESCRIPTION π¦
so this package hands you generic commands that build full base32 mappings out of a basic mapping β and the basic one is lowkey minimal, it just lists the codes and the characters that go with them. the full mappings it creates? there's a regular one and an inverse one, and they map to and from bit sequences, and they also handle the partial mappings that show up at the end of a string. the way she handles the awkward end-of-string bits... obsessed. ππ
and now the real talk, bestie, because this is important:
this is, in essence, an internal package. it exists for the implementors of a base32 en- and decoder. a regular user has no need of this package at all. like, none. zero. if you're just vibing and want to encode stuff, this is not your girl. π
π API π
π ::base32::core::define map forwvar backwvar ivar
this command computes the full forward and backward (inverse) mappings from the basic map, and stores them in the variables named by forwvar and backwvar respectively (resp., as the oldheads say π
).
she also constructs a regexp pattern for detecting invalid characters in supposedly base32 encoded input, and drops that into the variable named by ivar. three variables, one command, main character energy. β
π ::base32::core::valid string pattern mvar
this one checks whether the input string is a valid base32 encoded string, based on the pattern of invalid characters (the one ::base32::core::define generated) plus some other general rules. vibe check, but for encoding. β
the result of the command is a boolean flag. it's True for a valid string, and False otherwise. and in that False case, an error message describing exactly what's wrong with the input gets stored into the variable named by mvar.
heads up bestie: the variable named by mvar is not touched if the input was found to be valid. she leaves it alone. respect. π
the rules she checks β beyond rejecting bad characters β are, in order:
- the length of the input is not a multiple of eight,
- the padding appears not at the end of input, but in the middle (padding in the middle?? jail. immediately. π),
- the padding has not of length six, four, three, or one characters.
π BUGS, IDEAS, FEEDBACK π
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's giving "we're all human." please report such things in the category base32 of the Tcllib Trackers:
http://core.tcl.tk/tcllib/reportlist
and please also report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. we eat them up. π
when proposing code changes, please provide unified diffs, i.e. the output of diff -u.
also note: attachments are strongly preferred over inlined patches. you can attach stuff by going to the Edit form of the ticket right after you create it, and then using the left-most button in the secondary navigation bar. iykyk. π§
πΈ KEYWORDS πΈ
base32
π CATEGORY π
Text processing
β¨ COPYRIGHT β¨
Public domain
and that's the whole page, bestie!! this little manual page came to you from tcllib, version 0.2, and it's the base32::core page, dated as ever. go forth and expand those maps πβ¨π¦π
π
π¦ 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms