docs::a...:Base64(3)

πŸ“¦ version 2.0.13, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

APR::Base64 β€” the Perl API that gives you APR's base64 encoding/decoding glow-up ✨ like it's literally the bridge between your cute little strings and APR's whole base64 situation.


🌸 Synopsis 🌸

okay bestie, here's the vibe:

use APR::Base64 ();

my $clear   = "foo"
my $encoded = APR::Base64::encode($clear);
my $decoded = APR::Base64::decode($encoded);
my $len_enc = APR::Base64::encode_len(length $clear);

(no i did not add semicolons, that's exactly how it is in the original, leave it πŸ’…)


πŸ¦‹ Description πŸ¦‹

APR::Base64 gives you access to APR's base64 encoding and decoding API. that's it. that's the whole pitch. it's giving "small module, big slay" πŸŽ€


✨ API ✨

APR::Base64 provides the following functions and/or methods β€” all three of them, and yes we're covering every single one, no skipping πŸ™ˆ

πŸ’œ decode

Decode a base64 encoded string. turn that scrambled text back into readable vibes πŸ”“

$decoded = decode($encoded);
  • arg1: $encoded ( string ) β€” the encoded string. the cryptic one. the "what does this even say" one.
  • ret: $decoded ( string ) β€” the decoded string. the reveal. the main character moment πŸ‘‘
  • since: 2.0.00

πŸ“ encode

Encode a string to base64. wrap your precious clear text up in a little disguise 🎁

$encoded = encode($clear);
  • arg1: $clear ( string ) β€” the unencoded string. plain, honest, unbothered.
  • ret: $encoded ( string ) β€” the encoded string. now it's all base64-ified ✨
  • since: 2.0.00

🌈 encode_len

Given the length of an unencoded string, get the length of the encoded string. yes it's just a length calculator but it's the length calculator and we respect her πŸ’…

$len_enc = encode_len($len_clear);
  • arg1: $len_clear ( integer ) β€” the length of an unencoded string
  • ret: $len_enc ( integer ) β€” the length of the string after it is encoded
  • since: 2.0.00
fr fr note: all three of these are since: 2.0.00, so if you're on something older, bestie... no. 😭

🧚 See Also 🧚

mod_perl 2.0 documentation. go read it, iykyk 🫢


mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.


πŸ’€ Authors πŸ’€

The mod_perl development team and numerous contributors. (the whole squad, can't forget them πŸ’–)


and that's the page!! brought to you by perl v5.42.3 on 2023-10-21 β€” mwah, go encode something cute πŸŒΈπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from