gnutls_hex_encode(3)

✨ NAME ✨

gnutls_hex_encode β€” bestie, it's an API function πŸ’–


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_hex_encode(const gnutls_datum_t * data, char * result, size_t * result_size);

πŸŽ€ ARGUMENTS πŸŽ€

  • const gnutls_datum_t * data β€” this is the raw data, the actual stuff, the un-encoded tea before it gets dressed up πŸ«–
  • char * result β€” the spot where the hex data is gonna get copied. Your lil destination. The runway πŸ’…
  • size_t * result_size β€” this holds the size of the result, and yes it's a pointer, so it's both telling you the size and getting updated, main character energy tbh ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so basically: this function takes the data you gave it and converts it into printable data using hex encoding, exactly the kind used in the PSK password files. No cap, that's the whole vibe πŸ”₯

Heads up bestie: the size of the result includes the null terminator. The \0 is part of the count. Don't forget them, or the vibe check will fail 😭

🌈 RETURNS 🌈

  • GNUTLS_E_SHORT_MEMORY_BUFFER β€” when the buffer you handed over is not long enough. Not me giving it a tiny buffer... πŸ’€
  • 0 β€” on success! Slay, we ate πŸ‘‘

πŸ› REPORTING BUGS πŸ›

Found a bug? Tell the people, they wanna know fr fr:


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

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.

(Translation: go off, copy it, just keep the receipts πŸ§ΎπŸ’–)


πŸ”— SEE ALSO πŸ”—

The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


And that's the whole page, bestie β€” this one lives in the gnutls manual, and it's from version 3.8.13 πŸŽ€πŸ’œ Byeee, go hex-encode something iconic βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from