Symisc UnQLite

An Embeddable NoSQL Database Engine

UnQLite C/C++ API Reference - Randomness.


int unqlite_util_random_string(unqlite *pDb,char *zBuf,unsigned int buf_size);
unsigned int unqlite_util_random_num(unqlite *pDb);

Generate random number and/or string using the UnQLite PRNG.


UnQLite is shipped with a high-quality pseudo-random number generator (PRNG). These interfaces allows host-applications to access the same PRNG for other purposes.

unqlite_context_random_num() returns a 32-bit unsigned integer between 0 and 0xFFFFFFFF.

unqlite_context_random_string() generate a english alphabet based string of length buf_size (last argument). Note that the generated string is not null terminated and the given buffer must be big enough to hold at least 3 bytes.



A pointer to a UnQLite database handle.

Return value

Random generated number and/or string.


Compile this C file for a smart introduction to these interfaces.

See also


Symisc Systems
Copyright © Symisc Systems