base64_encode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… base64_encode(9) β€” your kernel's glow-up for binary data

okay so real talk, this is a page from the Kernel API Manual and it's literally about turning cursed raw bytes into cute little ASCII text. bestie, it's base64_encode, and yes she ate πŸŽ€


✨ SYNOPSIS ✨

int base64_encode (const u8 *src , int srclen , char *dst , bool padding
, enum base64_variant variant );

that's the whole vibe right there. five args, one int back. no cap πŸ’–


🌸 ARGUMENTS 🌸

  • src β€” the binary data you wanna encode, gorl. this is the actual raw stuff going in πŸ¦‹
  • srclen β€” how long src is, measured in bytes. gotta tell her the size or she's just guessing 😭
  • dst β€” (output) the Base64-encoded string lands here. and listen: it is Not NUL-terminated. not. NUL. terminated. so do NOT go treating it like a cozy little C string and strlen her, iykyk πŸ’€
  • padding β€” a bool, bestie. whether to append '=' padding characters or not. your choice, your aesthetic ✨
  • variant β€” which base64 variant to use. yeah there's more than one, main character energy demands options πŸ‘‘

🧚 DESCRIPTION 🧚

Encodes data using the selected Base64 variant. that's it, that's the plot. you hand her bytes, she hands you back something text-shaped and iconic 🌈


⭐ RETURN ⭐

returns the length of the resulting Base64-encoded string in bytes. so like, the number you get back tells you how big dst ended up. use it! don't ignore her! 🫢


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./lib/base64.c
  • base64_decode(9) β€” the reverse girly, go check her out πŸ’œ

πŸ’… friendly reminder from your girl: dst is not NUL-terminated. i'm bringing it up twice because it's the kind of thing that will bite you at 3am and i refuse to let that happen to you. periodt.

k bye ily, this page lives in ./lib and the version/date stamp on it is October 2026 β€” signed, sealed, slayed πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from