gsasl_base64_to(3)

πŸ’– gsasl_base64_to(3) πŸ’–

okay bestie, welcome to the gsasl manual, page for gsasl_base64_to. pull up a chair, grab a boba, we're encoding bytes today ✨


🌸 NAME 🌸

gsasl_base64_to β€” it's an API function, and it's lowkey iconic πŸ’…


✨ SYNOPSIS ✨

#include <gsasl.h>

int gsasl_base64_to(const char * in, size_t inlen, char ** out, size_t *
outlen);

like yes, one header, one function call, we love a minimal include πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const char * in β€” your input byte array. the raw material. the moment before the glow-up 🌈
  • size_t inlen β€” how big that input byte array is. yes queen, we need the length 🫢
  • char ** out β€” a pointer to a freshly allocated base64-encoded string. brand new, never worn, allocated just for you πŸ‘‘
  • size_t * outlen β€” a pointer to the size of that newly allocated base64-encoded string. the receipts, basically 🧾

πŸ’œ DESCRIPTION πŸ’œ

So what it does: it encodes data as base64. that's the whole vibe. πŸ”₯

The out string is zero terminated, and outlen holds the length excluding the terminating zero. so don't go counting the null byte as part of the party, bestie πŸ’€

The out buffer must be deallocated by the caller. that's on you. it's giving "you break it, you bought it" β€” the function mallocs, you free. no cap πŸ™ˆ

Return value: it hands back GSASL_OK on success πŸ’– β€” or GSASL_MALLOC_ERROR if the input was too large or memory allocation failed. (yes, the original says "memory allocation fail", we're keeping that exactly as-is, it's canon now πŸŽ€)

⚠️ quick vibe check: if you forget to free out, that's a leak. the function will not do it for you. be the main character who calls free() πŸ’…

⭐ SINCE ⭐

0.2.2 β€” a classic. vintage. been here since way back πŸ•°οΈβœ¨


🌈 REPORTING BUGS 🌈

found a bug? spill it, but like, to the right people πŸ’Œ


Copyright Β© 2002-2026 Simon Josefsson.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.


🐚 SEE ALSO 🐚

The full documentation for gsasl is maintained as a Texinfo manual. If the info and gsasl programs are properly installed at your site, the command

info gsasl

should give you access to the complete manual. As an alternative you may obtain the manual from:

https://www.gnu.org/software/libidn/gsasl/manual/

and that's the whole page, bestie 🫢 go forth and encode responsibly. this was gsasl version 2.2.4, delivered straight from the gsasl_base64_to(3) manual page. mwah πŸ’‹

πŸ“¦ where this page comes from