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:
- report bugs to
<bugs@gnutls.org>π - home page:
https://www.gnutls.orgπ
β¨ COPYRIGHT β¨
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms