[https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/base64/base64.html%|%base64], a [Tcllib] module, provides commands for encoding and decoding binary data in [base64]. In Tcl [Tcl 8.6%|%8.6], it has largely been superceded by `[binary]`, which also provides base64 encoding and decoding. ** Sub-modules ** [uuencode]: [yencode]: [http://en.wikipedia.org/wiki/Ascii85%|%ascii85]: ** Documentation ** [http://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/base64/base64.html%|%official reference] (alternates [http://tcllib.sourceforge.net/doc/base64.html%|%1], [http://docs.activestate.com/activetcl/8.5/tcllib/base64/base64.html%|%2]: ** See Also ** [Base 64 encode/decode]: shows an example of this [Tcllib] module at work. [http://code.activestate.com/recipes/117247/%|%Inline GIF image into code] ,[Cookbook]: an example of processesing [GIF]s using base64 [Simple Base64 Gif encoder]: another example ** Obsolete Information ** The following information is no longer particularly relevant. It remains for historical purposes. The base64 which is part of tcllib is slow, and catastrophically memory-hungry for large (on the order of a megabyte or more) sources. The memory disaster results from what [Donal Fellows] reports as a bug to SourceForge [http://sourceforge.net/bugs/?func=detailbug&bug_id=131523&group_id=10894]. He provided a patch as well [http://sourceforge.net/patch/?func=detailpatch&patch_id=103709&group_id=10894]. Although it doesn't help performance significantly in the cases of interest to [Cameron Laird], a simple fix for the memory woe is to overide base64::decode with a version which substitutes ====== set length [string length $string] for {set ii 0} {$ii < $length} {incr ii} { set char [string range $string $ii $ii] ... ====== for ====== foreach char [split $string {}] { ... ====== ''Note: in the current version in tcllib (version 2.2.1 of base64), this code has been replaced by'' ====== binary scan $string c* X foreach x $X { ====== <> base64