GENRANDOM(3)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so this is GENRANDOM(3), straight outta the Library Functions Manual, and it's all about genrandom, prng β€” random number generation, bestie. Like, the whole β€œwhere do unguessable numbers come from” situation. ✨

🌸 SYNOPSIS 🌸

#include <u.h>
#include <libc.h>
#include <mp.h>
#include <libsec.h>

void genrandom(uchar *buf, int nbytes)

void prng(uchar *buf, int nbytes)

πŸ¦‹ DESCRIPTION πŸ¦‹

Most security software literally requires a source of random numbers β€” or, at the very least, numbers you can’t guess. no cap. πŸ’…

  • genrandom fills a buffer with bytes from the X9.17 pseudo-random number generator. The X9.17 generator is seeded by 24 truly random bytes read via truerand (see rand(3)). πŸŽ€
  • prng uses the native rand(3) pseudo-random number generator to fill the buffer. Used with srand, this function can produce a reproducible stream of pseudo random numbers useful in testing. 🫢

Both functions may be passed to mprand (see mp(3)). 🌈

⭐ SOURCE ⭐

/src/libsec

πŸ‘‘ SEE ALSO πŸ‘‘


that’s the GENRANDOM(3) page, sourced from /src/libsec β€” and tbh this one doesn’t print a date or version line, so I’m not gonna invent one, bestie. πŸ’–