base32(n)
β¨ base32(n) β the Base32 encoding era β¨
okay bestie, sit down, hydrate, and let me tell you about base32, the Tcl package that encodes and decodes your strings in the standard base32 encoding, exactly like RFC 3548 says. it's giving β¨data integrityβ¨, it's giving π lowercase-tolerant decoder energyπ, it's lowkey iconic. π
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require base32::core ?0.2?
package require base32 ?0.2?
::base32::encode string
::base32::decode estring
like yes, she requires Tcl 8.5 and 9, and she's rocking version 0.2 of both base32::core and base32. the ?0.2? is just the version constraint being cute and optional-ish, iykyk. π«Ά
π DESCRIPTION π
so basically this package hands you the commands for encoding and decoding strings into and out of the standard base32 encoding as specified in RFC 3548. that's it, that's the vibe. encode in, decode out, slay. π
π API π
π ::base32::encode string
this one takes the given string, encodes it in base32, and returns the encoded string as its result. periodt. π
and here's the tea: the result may be padded with the character = to signal a partial encoding at the end of the input string. so if the math doesn't line up all nice, she pads it. she's polite like that. β¨
π¦ ::base32::decode estring
this command takes the estring and decodes it under the assumption that it's a valid base32 encoded string. the result of the decoding gets returned as the result of the command. easy. π
now, important note, bestie: while the encoder will generate only uppercase characters, this decoder accepts input in lowercase as well. she's not picky, she's flexible, she's main character energy. π
and listen β the command will always throw an error whenever it encounters conditions which signal some type of bogus input. namely if:
- the input contains characters which are not valid output of a base32 encoder,
- the length of the input is not a multiple of eight,
- padding appears not at the end of input, but in the middle,
- the padding has not of length six, four, three, or one characters,
not me getting emotionally attached to a decoder that actually yells at you when something's wrong π like yes girl, boundaries!
π§ CODE MAP π§
this is the code map used to convert 5-bit sequences. the numeric id of the bit sequences is on the left, and the character used to encode it is on the right. π«
and here's a fun fact you need to know: the characters "0" and "1" are not used by the encoding. why? because those characters can be easily confused with "O", "o" and "l" (L). not her being considerate about your eyesight π obsessed.
0 A 9 J 18 S 27 3
1 B 10 K 19 T 28 4
2 C 11 L 20 U 29 5
3 D 12 M 21 V 30 6
4 E 13 N 22 W 31 7
5 F 14 O 23 X
6 G 15 P 24 Y
7 H 16 Q 25 Z
8 I 17 R 26 2
π BUGS, IDEAS, FEEDBACK π
ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. like, they said it themselves, fr fr. π
so please report such in the category base32 of the Tcllib Trackers at [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. they want your thoughts, bestie, they're listening. π«Ά
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
note further that attachments are strongly preferred over inlined patches. attachments can be made 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. like, the left-most one. the very first one. don't overthink it. π
π KEYWORDS π
base32rfc3548
π CATEGORY π
Text processing
β COPYRIGHT β
Public domain
and that's the whole page, bestie!! this was the base32(n) man page from tcllib, version 0.2, and yeah, it's literally all public domain so go wild. mwah, take care of your strings, stay padded at the end only, and never put your padding in the middle. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms