xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_randomness.3 (revision 53b02e147d4ed531c0d2a5ca9b3e8026ba3e99b5)
1.Dd December 19, 2018
2.Dt SQLITE3_RANDOMNESS 3
3.Os
4.Sh NAME
5.Nm sqlite3_randomness
6.Nd Pseudo-Random Number Generator
7.Sh SYNOPSIS
8.Ft void
9.Fo sqlite3_randomness
10.Fa "int N"
11.Fa "void *P"
12.Fc
13.Sh DESCRIPTION
14SQLite contains a high-quality pseudo-random number generator (PRNG)
15used to select random  ROWIDs when inserting new records into
16a table that already uses the largest possible ROWID.
17The PRNG is also used for the build-in random() and randomblob() SQL
18functions.
19This interface allows applications to access the same PRNG for other
20purposes.
21.Pp
22A call to this routine stores N bytes of randomness into buffer P.
23The P parameter can be a NULL pointer.
24.Pp
25If this routine has not been previously called or if the previous call
26had N less than one or a NULL pointer for P, then the PRNG is seeded
27using randomness obtained from the xRandomness method of the default
28sqlite3_vfs object.
29If the previous call to this routine had an N of 1 or more and a non-NULL
30P then the pseudo-randomness is generated internally and without recourse
31to the sqlite3_vfs xRandomness method.
32.Sh SEE ALSO
33.Xr sqlite3_vfs 3
34