libwebsockets
Lightweight C library for HTML5 websockets
|
Data Structures | |
struct | lws_b64state |
Functions | |
LWS_VISIBLE LWS_EXTERN unsigned char * | lws_SHA1 (const unsigned char *d, size_t n, unsigned char *md) |
LWS_VISIBLE LWS_EXTERN int | lws_b64_encode_string (const char *in, int in_len, char *out, int out_size) |
LWS_VISIBLE LWS_EXTERN int | lws_b64_encode_string_url (const char *in, int in_len, char *out, int out_size) |
LWS_VISIBLE LWS_EXTERN int | lws_b64_decode_string (const char *in, char *out, int out_size) |
LWS_VISIBLE LWS_EXTERN int | lws_b64_decode_string_len (const char *in, int in_len, char *out, int out_size) |
LWS_VISIBLE LWS_EXTERN void | lws_b64_decode_state_init (struct lws_b64state *state) |
LWS_VISIBLE LWS_EXTERN int | lws_b64_decode_stateful (struct lws_b64state *s, const char *in, size_t *in_len, uint8_t *out, size_t *out_size, int final) |
These provide SHA-1 and B64 helper apis
LWS_VISIBLE LWS_EXTERN int lws_b64_decode_string | ( | const char * | in, |
char * | out, | ||
int | out_size | ||
) |
#include <include/libwebsockets/lws-sha1-base64.h>
lws_b64_decode_string(): decode a string from base 64
in | incoming buffer |
out | result buffer |
out_size | length of result buffer |
Decodes a NUL-terminated string using b64
LWS_VISIBLE LWS_EXTERN int lws_b64_decode_string_len | ( | const char * | in, |
int | in_len, | ||
char * | out, | ||
int | out_size | ||
) |
#include <include/libwebsockets/lws-sha1-base64.h>
lws_b64_decode_string_len(): decode a string from base 64
in | incoming buffer |
in_len | length of incoming buffer |
out | result buffer |
out_size | length of result buffer |
Decodes a range of chars using b64
LWS_VISIBLE LWS_EXTERN int lws_b64_encode_string | ( | const char * | in, |
int | in_len, | ||
char * | out, | ||
int | out_size | ||
) |
#include <include/libwebsockets/lws-sha1-base64.h>
lws_b64_encode_string(): encode a string into base 64
in | incoming buffer |
in_len | length of incoming buffer |
out | result buffer |
out_size | length of result buffer |
Encodes a string using b64
LWS_VISIBLE LWS_EXTERN int lws_b64_encode_string_url | ( | const char * | in, |
int | in_len, | ||
char * | out, | ||
int | out_size | ||
) |
#include <include/libwebsockets/lws-sha1-base64.h>
lws_b64_encode_string_url(): encode a string into base 64
in | incoming buffer |
in_len | length of incoming buffer |
out | result buffer |
out_size | length of result buffer |
Encodes a string using b64 with the "URL" variant (+ -> -, and / -> _)
LWS_VISIBLE LWS_EXTERN unsigned char* lws_SHA1 | ( | const unsigned char * | d, |
size_t | n, | ||
unsigned char * | md | ||
) |
#include <include/libwebsockets/lws-sha1-base64.h>
lws_SHA1(): make a SHA-1 digest of a buffer
d | incoming buffer |
n | length of incoming buffer |
md | buffer for message digest (must be >= 20 bytes) |
Reduces any size buffer into a 20-byte SHA-1 hash.