nanoid(3) | Library Functions Manual | nanoid(3) |
nanoid
— generate
a Nano ID
#include
<nanoid.h>
NANOID
();
char *
nanoid
(size_t
length);
NANOID
()
generates a Nano ID of the default length. Expands to
nanoid
(21).
nanoid
() generates a Nano ID of the given
length ≤256. Returns a newly allocated null-terminated string with
the ID, or NULL
if calloc(3) or
getentropy(3) fail.
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.
Luka Teras <luka@sdf.org>
December 8, 2024 |