An Embeddable Datastore Engine |
Tweet |
Follow @Vedis |
Vedis C/C++ API Reference - Randomness.
int vedis_util_random_string(vedis *pStore,char *zBuf,unsigned int buf_size);
unsigned
int vedis_util_random_num(vedis *pStore);
Built-in Randomness.
Description
Vedis is shipped with a high-quality pseudo-random number generator (PRNG). These interfaces allows host-applications to access the same PRNG for other purposes.
vedis_util_random_num() returns a 32-bit unsigned integer between 0 and 0xFFFFFFFF.
vedis_util_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.
Parameters
pStore |
Vedis datastore handle. |
Return value
Random generated number and/or string.