base64(3)

✨ NAME ✨

okay so bestie, welcome to base64(3) from the Library Functions Manual β€” she's giving decode and encode from/to BASE64 energy, and honestly? iconic. πŸ’–

  • base64 β€” decode and encode from/to BASE64

🧚 SYNTAX 🧚

here's the exact spellbook, bestie β€” copy it character for character:

#include "base64.h"

int b64decode(in,len,out);

const unsigned char *in; int len;
stralloc *out;

int b64encode(in,out);

stralloc *int;
stralloc *out;
yes, the b64encode block really does say stralloc *int; β€” not me editing it, that's literally the page. πŸ’€

🌸 DESCRIPTION 🌸

b64decode takes the given BASE64 encoded string that's available at in with length len on input, and returns the corresponding (binary) character stream on output. out is not '\0' terminated. b64decode respects BASE64 decoding defined by RFC 4648 in order to allow processing of URLs and path names. ✨

The return value of b64decode is ´0´ in case of success, and it might be '-1' in case of memory shortage. 😭

b64encode takes an input data stream in and translates it into the BASE64 format to be supplied at out, potentially padded with trailing '='. πŸŽ€

The return value of b64decode is Β΄0Β΄ in case of success and might be '-1' in case of memory shortage. And yes, this paragraph is about b64encode but the page literally says b64decode here too β€” I'm just reporting the tea, not fixing it πŸ’….

πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, bestie:

πŸ’Œ cute sign-off: that's the whole base64(3) page from the Library Functions Manual, and this copy's footer is just base64(3) β€” no source/version/date line to spill, so that's all the tea β˜•πŸ’– stay slay, bestie 🫢
πŸ“¦ where this page comes from