xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_randomness.3 (revision a24efa7dea9f1f56c3bdb15a927d3516792ace1c)
1.Dd $Mdocdate$
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.
23If N is less than one, then P 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, then the PRNG is seeded using randomness obtained
27from the xRandomness method of the default sqlite3_vfs object.
28If the previous call to this routine had an N of 1 or more then the
29pseudo-randomness is generated internally and without recourse to the
30sqlite3_vfs xRandomness method.
31.Sh SEE ALSO
32.Xr sqlite3_vfs 3
33