base64(3erl)
Hey bestie π this is the base64(3erl) page β an Erlang Module Definition β and it's here to hand you base64 encode and decode, with RFC 2045 as the reference. Short page, big slay. β¨
πΈ NAME πΈ
base64 β provides base64 encode and decode, see RFC 2045. That's the name, bestie, and it ate. π
π DESCRIPTION π
Okay so this module provides base64 encode and decode, see RFC 2045.
That's literally the whole description. No secret lore, no side quests. It encodes, it decodes, it references the RFC. Iconic minimalism, periodt. π
𧬠DATA TYPES π§¬
Type check time, bestie! Here's the whole little cast π«Ά
base64_alphabet() = 65..90 | 97..122 | 48..57 | 43 | 47 | 61β the Base 64 Encoding alphabet, withRFC 4648as the receipt. It's giving alphabet but make it base64 π .base64_string() = [base64_alphabet()]β Base 64 encoded string. Cute little list of alphabet characters, no cap. πbase64_binary() = binary()β Base 64 encoded binary. Binary bestie, you know the vibe. π¦byte_string() = [byte()]β Arbitrary sequences of octets. Octets! Love that for us. πΈ
π EXPORTS π
Function time, and yes every signature is sacred. Let's go π₯
Decode squad π
decode(Base64) -> Data
decode_to_string(Base64) -> DataString
mime_decode(Base64) -> Data
mime_decode_to_string(Base64) -> DataString
Types:
Base64 = base64_string() | base64_binary()
Data = binary()
DataString = byte_string()
This crew decodes a base64-encoded string to plain ASCII. See RFC 4648.
Here's the tea: mime_decode/1 and mime_decode_to_string/1 strip away illegal characters, while decode/1 and decode_to_string/1 only strip away whitespace characters. So the MIME girlies are the ones yeeting illegal chars; the regular decode besties are just handling whitespace. π
Encode squad π₯
encode(Data) -> Base64
encode_to_string(Data) -> Base64String
Types:
Data = byte_string() | binary()
Base64 = base64_binary()
Base64String = base64_string()
This one encodes a plain ASCII string into base64. The result is 33% larger than the data. Yep, 33% bigger β that's the base64 tax, bestie. πΈβ¨
Big sparkle kisses to Ericsson AB π β this page is from stdlib 4.3.1.3, manual base64(3erl), and that's a wrap. Bye bestie, go encode something cute! ππ
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms