#include "base64.h"
Include dependency graph for base64.cc:
Go to the source code of this file.
Functions | |
ssize_t | Base64Encode (const char *_in, size_t inlen, char *_out, size_t outlen, uint32 *state, int lwidth) |
ssize_t | Base64Decode (const char *_in, size_t inlen, char *_out, size_t outlen, uint32 *state) |
Variables | |
const unsigned char * | _base64_encode |
const unsigned char * | _base64_decode |
|
For internal use only. Reads in the base64 encoded string passed in _in of size inlen and stores the decoded result in buffer _out of size outlen. If state is non-NULL state info is updated. State info (carry) is needed only if you have a large amount of base64 data which cannot be decoded in one single call. To do this, set up the uint32 state value to zero and pass a pointer to it whenever calling Base64Decode(). The function will store non-decoded chars (max. 18 bits + 2 bit counter) in state to be able to process them the next time unless
Definition at line 178 of file base64.cc. References _base64_decode, ssize_t, and uint32. |
|
For internal use only. Reads in binary (8 bit) input data in _in of size inlen and encodes it as base64 storing the result in _out of size outlen. You may set lwidth to something non-zero to make Base64Encode() insert newlines every lwidth*4 chars. (lwidth=1 -> every 4 chars; lwidth=0 -> disable this feature) If state is non-NULL state info is updated. State info (carry) is needed only if you have a large amount of 8bit data which cannot be encoded in one single call. To do this, set up the uint32 state value to zero and pass a pointer to it whenever calling Base64Encode(). The function will store non-encoded bytes (max. 2 bytes + 2 bit counter) in state to be able to process them the next time unless you call Base64Encode() with inlen=0 to tell it that this is the end of the input data. (state will be 0 after that but better relay on the return values for error diagnosis.) When reaching input data end (either state!=NULL and inlen=0 or state=NULL), the base64 termination char `=' is appended to the output.
Definition at line 71 of file base64.cc. References _base64_encode, ssize_t, and uint32. |
|
Initial value: (const unsigned char *) "\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" "\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3e\xff\xff\xff\x3f" "\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\xff\xff\xff\xfd\xff\xff" "\xff\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e" "\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\xff\xfe\xff\xff\xff" "\xff\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28" "\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\xff\xff\xff\xff\xfe" Definition at line 31 of file base64.cc. Referenced by Base64Decode(). |
|
Initial value: (unsigned char *) "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/" Definition at line 21 of file base64.cc. Referenced by Base64Encode(). |