gnutls_rnd(3)

πŸ’– gnutls_rnd(3) πŸ’–

okay bestie, welcome to the gnutls manual, and specifically to gnutls_rnd(3) β€” the little function that hands you randomness and honestly? she's a queen for it. πŸŽ€


✨ NAME ✨

gnutls_rnd β€” literally just an API function, no biggie, but make it iconic πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/crypto.h>

int gnutls_rnd(gnutls_rnd_level_t level, void * data, size_t len);

look at her. so simple. so powerful. πŸ¦‹


✨ ARGUMENTS ✨

  • gnutls_rnd_level_t level β€” the security level, aka how serious we're being rn. you gotta pick wisely, bestie πŸ‘‘
  • void * data β€” this is where the random bytes go. it's the lil bucket you're holding out, and she's gonna fill it πŸ“
  • size_t len β€” how much you're asking for. the requested size. the amount. the vibe check on volume ✨

✨ DESCRIPTION ✨

so this function generates random data and drops it straight into your output buffer. no cap. 🌈

the value you pass as level should be one of GNUTLS_RND_NONCE, GNUTLS_RND_RANDOM or GNUTLS_RND_KEY. if you want the full tea on what each one means, go read the manual and the gnutls_rnd_level_t docs β€” they have the detailed information, i'm just here to hype you up πŸ’–

and the best part?? this function is thread-safe AND fork-safe. she does not crumble under pressure. main character energy fr fr 😭πŸ”₯


✨ RETURNS ✨

zero on success 🫢 or a negative error code if something went wrong 😭 (we don't love that, but at least she tells you).


✨ SINCE ✨

2.12.0 β€” she's been serving since way back, a true veteran of the game πŸ’œ


✨ REPORTING BUGS ✨

found a bug? don't just scream into the void, tell the devs:


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. so yes bestie, you can share it, just keep the receipts πŸ“œβœ¨


✨ SEE ALSO ✨

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

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

that's your one-stop shop for all the lore πŸ“šπŸ¦‹


okay that's the whole page, and yes it's from gnutls version 3.8.13, dated as gnutls_rnd(3) β€” stay random, stay safe, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from