Strophe
0.10
XMPP client library
|
Functions | |
xmpp_rand_t * | xmpp_rand_new (xmpp_ctx_t *ctx) |
Create new xmpp_rand_t object. More... | |
void | xmpp_rand_free (xmpp_ctx_t *ctx, xmpp_rand_t *rand) |
Destroy an xmpp_rand_t object. More... | |
int | xmpp_rand (xmpp_rand_t *rand) |
Generate random integer. More... | |
void | xmpp_rand_bytes (xmpp_rand_t *rand, unsigned char *output, size_t len) |
Generate random bytes. More... | |
void | xmpp_rand_nonce (xmpp_rand_t *rand, char *output, size_t len) |
Generate a nonce that is printable randomized string. More... | |
xmpp_rand_t* xmpp_rand_new | ( | xmpp_ctx_t * | ctx | ) |
Create new xmpp_rand_t object.
ctx | A Strophe context object |
void xmpp_rand_free | ( | xmpp_ctx_t * | ctx, |
xmpp_rand_t * | rand | ||
) |
Destroy an xmpp_rand_t object.
ctx | A Strophe context object |
int xmpp_rand | ( | xmpp_rand_t * | rand | ) |
Generate random integer.
Analogue of rand(3).
void xmpp_rand_bytes | ( | xmpp_rand_t * | rand, |
unsigned char * | output, | ||
size_t | len | ||
) |
Generate random bytes.
Generates len bytes and stores them to the output buffer.
void xmpp_rand_nonce | ( | xmpp_rand_t * | rand, |
char * | output, | ||
size_t | len | ||
) |
Generate a nonce that is printable randomized string.
This function doesn't allocate memory and doesn't fail.
output | A buffer where a NULL-terminated string will be placed. The string will contain len-1 printable symbols. |
len | Number of bytes reserved for the output string, including end of line '\0'. |