SPVM::MIME::Base64(3)
โจ SPVM::MIME::Base64 โจ
Okay bestie, welcome to SPVM::MIME::Base64, coming at you from the User Contributed Perl Documentation section of the SPVM::MIME::Base64(3) manual โ yes that's the whole title, we're being thorough ๐
๐ธ Name ๐ธ
SPVM::MIME::Base64 โ Base64 Encoding/Decoding. That's it, that's the vibe. ๐
๐ฆ Description ๐ฆ
So the MIME::Base64 class in SPVM has methods for Base64 <https://en.wikipedia.org/wiki/Base64> encoding/decoding. Like, that's literally the whole job and it does it beautifully. ๐
๐ Usage ๐
Take a look at this icon:
use MIME::Base64;
my $encoded = MIME::Base64->encode_base64('Aladdin:open sesame');
my $decoded = MIME::Base64->decode_base64($encoded);
Encode, decode, slay, repeat. ๐โจ
๐ง Class Methods ๐ง
โญ encode_base64
static method encode_base64 : string ($string : string, $eol : string = undef);
Encodes the string $string to a Base64 string, and returns it. Simple as that, no cap. ๐ซถ
The argument $eol is the line-ending sequence to use. It's optional and defaults to "\n".
The returned encoded string is broken into lines of no more than 76 characters each and it will end with $eol unless it is empty.
Pass an empty string as the $eol if you do not want the encoded string to be broken into lines. (No line breaks, no drama. ๐)
Exceptions:
$string must be defined. Otherwise an exception is thrown. ๐จ
โญ decode_base64
static method decode_base64 : string ($string : string);
Decodes a Base64 string $string to a string, and returns it. The reverse glow-up, honestly. ๐ฅ
Any character not part of the 65-character base64 subset is silently ignored. Characters occurring after a "=" padding character are never decoded. (Yeah, everything past the padding is giving "not invited to the party" ๐)
Exceptions:
$string must be defined. Otherwise an exception is thrown. ๐จ
โญ encoded_base64_length
static method encoded_base64_length : int ($string : string, $eol : string = undef);
Returns the length that the encoded string would have without actually encoding it. Math, but make it effortless. ๐งฎโจ
This will return the same value as the length of the returned value of the "encode_base64" method, but should be more efficient. Efficiency is so main character energy. ๐
Exceptions:
$string must be defined. Otherwise an exception is thrown. ๐จ
โญ decoded_base64_length
static method decoded_base64_length : int ($string : string);
Returns the length that the decoded string would have without actually decoding it.
This will return the same value as the length of the returned value of the "decode_base64" method, but should be more efficient. Again โ all the answers, none of the work. ๐
Exceptions:
$string must be defined. Otherwise an exception is thrown. ๐จ
๐ Other Modules in This Distribution ๐
SPVM::MIME::QuotedPrintโ the sibling module, we love a family moment ๐ซถ
๐ See Also ๐
MIME::QuotedPrintโSPVM::MIME::QuotedPrintis aMIME::QuotedPrintporting to SPVM
๐ Repository ๐
SPVM::MIME::Base64 โ Github <https://github.com/yuki-kimoto/SPVM-MIME-Base64>
๐ Author ๐
Yuki Kimoto (kimoto.yuki@gmail.com)
๐ Contributors ๐
Yoshiyuki Ito <https://github.com/YoshiyukiItoh>
๐ธ Copyright & License ๐ธ
Copyright (c) 2023 Yuki Kimoto
MIT License
Okay bestie that's the whole page, you ate it up ๐ Go forth and encode responsibly. ๐ฆ
perl v5.42.2 ยท 2026-02-03 ยท SPVM::MIME::Base64(3) โ mwah, catch you in the next manpage ๐โจ
๐ฆ where this page comes from
- alpine 3.24: spvm-mime-base64-doc 1.003-r2 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms