Strophe 0.12
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 |
rand | A xmpp_rand_t 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.
rand | A xmpp_rand_t object |
output | A buffer where a len random bytes will be placed. |
len | Number of bytes reserved for the output.. |
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.
rand | A xmpp_rand_t object |
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'. |