From 91995975521849a7a35921f7bbc25397eed78d52 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 6 Oct 2024 19:49:26 -0700 Subject: Convert nng_random to new format. --- docs/ref/SUMMARY.md | 4 ++++ docs/ref/api/util.md | 3 --- docs/ref/api/util/index.md | 6 ++++++ docs/ref/api/util/nng_random.md | 25 +++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) delete mode 100644 docs/ref/api/util.md create mode 100644 docs/ref/api/util/nng_random.md diff --git a/docs/ref/SUMMARY.md b/docs/ref/SUMMARY.md index 72b7dd94..9a459383 100644 --- a/docs/ref/SUMMARY.md +++ b/docs/ref/SUMMARY.md @@ -3,11 +3,15 @@ - [API](./api.md) - [Threading Functions](./api/thr/index.md) + - [nng_mtx](./api/thr/nng_mtx.md) + - [Utility Functions](./api/util/index.md) + - [nng_clock](./api/util/nng_clock.md) - [nng_id_map](./api/util/nng_id_map.md) - [nng_msleep](./api/util/nng_msleep.md) + - [nng_random](./api/util/nng_random.md) - [Transports](./tran/index.md) diff --git a/docs/ref/api/util.md b/docs/ref/api/util.md deleted file mode 100644 index 0ea03878..00000000 --- a/docs/ref/api/util.md +++ /dev/null @@ -1,3 +0,0 @@ -# Utility Functions - -- [nng_id_map](./util/nng_id_map.md) diff --git a/docs/ref/api/util/index.md b/docs/ref/api/util/index.md index 9f155b65..e11692c6 100644 --- a/docs/ref/api/util/index.md +++ b/docs/ref/api/util/index.md @@ -1,5 +1,11 @@ # Utility Functions +This section documents various utility functions that may help +with application portability. These are not fundamental to NNG +or Scalability Protocols, but we find them useful for a variety +of other uses. + - [nng_clock](nng_clock.md) - [nng_id_map](nng_id_map.md) - [nng_msleep](nng_msleep.md) +- [nng_random](nng_random.md) diff --git a/docs/ref/api/util/nng_random.md b/docs/ref/api/util/nng_random.md new file mode 100644 index 00000000..160752ab --- /dev/null +++ b/docs/ref/api/util/nng_random.md @@ -0,0 +1,25 @@ +# nng_random + +## NAME + +nng_random --- get random number + +## SYNOPSIS + +```c +#include + +uint32_t nng_random(void); +``` + +## DESCRIPTION + +The `nng_random` returns a random number. +The value returned is suitable for use with cryptographic functions such as +key generation. +The value is obtained using platform-specific cryptographically strong random +number facilities when available. + +## RETURN VALUES + +Returns a random 32-bit value. -- cgit v1.2.3-70-g09d2