.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MONGOC_RAND" "3" "May 07, 2024" "1.27.1" "libmongoc" .sp MongoDB Random Number Generator .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX void mongoc_rand_add (const void *buf, int num, double entropy); void mongoc_rand_seed (const void *buf, int num); int mongoc_rand_status (void); .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp The \fBmongoc_rand\fP family of functions provide access to the low level randomness primitives used by the MongoDB C Driver. In particular, they control the creation of cryptographically strong pseudo\-random bytes required by some security mechanisms. .sp While we can usually pull enough entropy from the environment, you may be required to seed the PRNG manually depending on your OS, hardware and other entropy consumers running on the same system. .SH ENTROPY .sp \fBmongoc_rand_add\fP and \fBmongoc_rand_seed\fP allow the user to directly provide entropy. They differ insofar as \fBmongoc_rand_seed\fP requires that each bit provided is fully random. \fBmongoc_rand_add\fP allows the user to specify the degree of randomness in the provided bytes as well. .SH STATUS .sp The \fBmongoc_rand_status\fP function allows the user to check the status of the mongoc PRNG. This can be used to guarantee sufficient entropy at program startup, rather than waiting for runtime errors to occur. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .