gsasl_hex_from(3)

✨ gsasl_hex_from(3) β€” the gsasl manual, but make it cute ✨

okay bestie, gather round, because today we're decoding some hex πŸ”₯ this one lives in the gsasl manual (that's the manual name, for the record), and it's literally just one little function that turns hex text back into real bytes. tiny function, big slay πŸ’…


πŸŽ€ NAME πŸŽ€

gsasl_hex_from β€” an API function. yes that's it. that's the whole name section. iconique brevity ✨


🌸 SYNOPSIS 🌸

#include <gsasl.h>

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

there she is 🫢 three args, one int return, no drama.


πŸ’– ARGUMENTS πŸ’–

  • const char * in β€” the input byte array. this is the hex-encoded stuff you're bringing to the party 🎊
  • char ** out β€” a pointer to a newly allocated output byte array. note the words "newly allocated", bestie, because that means it's yours to deal with later 🫣
  • size_t * outlen β€” a pointer to the size of that newly allocated output byte array. so it tells you how big the thing it just made for you actually is πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: this decodes hex data. that's the vibe check, it passed βœ…

the <red>out` buffer must be deallocated by the caller β€” like, that's on you, not on the function. the function makes it, you free it. no cap, don't leak it 😭

and here's the return value tea, in order:

  • returns GSASL_OK on success πŸŽ‰
  • returns GSASL_BASE64_ERROR if the input was invalid πŸ‘€ (yes, the hex function returns a base64 error constant, and no, i don't make the rules, i just report them)
  • returns GSASL_MALLOC_ERROR on memory allocation errors πŸ’€

🌈 SINCE 🌈

1.10 β€” so it's been around a minute, certified classic πŸ‘‘


πŸ’œ REPORTING BUGS πŸ’œ

found a bug? not me being the bug reporter but ok, here's where to go:


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. free as in freedom, periodt πŸ•ŠοΈ


🧚 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/

iykyk πŸ“š


and that's the whole page, bestie!! this was gsasl version 2.2.4 in the gsasl manual, page gsasl_hex_from(3), and honestly? decoding hex has never felt more main character πŸ’…βœ¨ slay responsibly and free your buffers πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from