Badger...:Base64(3pm)
π Badger::Codec::Base64 π
okay bestie, so this page is literally the manual for Badger::Codec::Base64(3pm), part of the Perl docs β and no cap, it's the cutest tiny little codec you ever did see. let's get into it π
β¨ NAME β¨
Badger::Codec::Base64 β encode/decode data using MIME::Base64 π¦
β¨ SYNOPSIS β¨
use Badger::Codec::Base64;
my $codec = Badger::Codec::Base64->new();
my $encoded = $codec->encode("Hello World");
my $decoded = $codec->decode($encoded);
likeβ¦ look at her. four lines. iconic. π
β¨ DESCRIPTION β¨
so this module is a subclass of Badger::Codec, and what she does is she borrows the encode_base64 and decode_base64 subroutines from the MIME::Base64 module to encode and decode your data. that's the whole gig fr fr πΈ
she is a very thin wrapper around MIME::Base64 β like, gossamer-thin, sheer, barely there π β and she offers no functional advantage over it. zero. none. she's not trying to out-perform anybody.
so why does she even exist?? because she provides a consistent API with the other Badger::Codec modules π«Ά that's it. that's the reason. she's here for the vibes and for the interface consistency, and honestly? relatable. π
β¨ METHODS β¨
π encode($data)
encodes the data referenced by the first argument using encode_base64() π
$encoded = Badger::Codec::Base64->encode($data);
π decode($data)
decodes the encoded data passed as the first argument using decode_base64() β¨
$decoded = Badger::Codec::Base64->decode($encoded);
π encoder()
this method returns a reference to the real subroutine that's doing all the encoding work, i.e. the encode_base64() method in MIME::Base64 π₯ like, she's not taking credit for the labor, she's just handing you the plug.
π decoder()
this method returns a reference to the real subroutine that's doing all the decoding work, i.e. the decode_base64() method in MIME::Base64 π¦ same energy, other direction.
β¨ AUTHOR β¨
Andy Wardley <http://wardley.org/> π
β¨ COPYRIGHT β¨
Copyright (C) 2005-2009 Andy Wardley. All rights reserved. π
β¨ SEE ALSO β¨
Badger::CodecsBadger::CodecMIME::Base64
and that's the whole page bestie, we ate and left absolutely no crumbs πβ¨ this was Badger::Codec::Base64, shipped as part of perl v5.36.0, dated 2023-08-28 β mwah, ily, go encode something π
π
π¦ where this page comes from
- debian trixie: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libbadger-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms