Badger...:Base64(3pm)

πŸ“¦
version 0.16 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute

πŸ’– 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 (C) 2005-2009 Andy Wardley. All rights reserved. πŸŽ€


✨ SEE ALSO ✨

  • Badger::Codecs
  • Badger::Codec
  • MIME::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