irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

base64.cpp File Reference
#include "rodsClient.h"
#include "base64.h"
Include dependency graph for base64.cpp:

Go to the source code of this file.

Macros

#define OK   0
 

Functions

int base64_encode (const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen)
 
int base64_decode (const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen)
 

Variables

static const char * codes
 
static const unsigned char mymap [256]
 

Macro Definition Documentation

◆ OK

#define OK   0

Definition at line 8 of file base64.cpp.

Function Documentation

◆ base64_decode()

int base64_decode ( const unsigned char *  in,
unsigned long  inlen,
unsigned char *  out,
unsigned long *  outlen 
)

base64 decode a block of memory

Parameters
inThe base64 data to decode
inlenThe length of the base64 data
out[out] The destination of the binary decoded data
outlen[in/out] The max size and resulting size of the decoded data
Returns
OK if successful

Definition at line 91 of file base64.cpp.

References BASE64_BUFFER_OVERFLOW, BASE64_INVALID_PACKET, mymap, OK, and manual_cleanup::out.

◆ base64_encode()

int base64_encode ( const unsigned char *  in,
unsigned long  inlen,
unsigned char *  out,
unsigned long *  outlen 
)

base64 Encode a buffer (NUL terminated)

Parameters
inThe input buffer to encode
inlenThe length of the input buffer
out[out] The destination of the base64 encoded data
outlen[in/out] The max size and resulting size
Returns
OK if successful

Definition at line 45 of file base64.cpp.

References irods.six::b(), BASE64_BUFFER_OVERFLOW, codes, OK, manual_cleanup::out, and pid_age::p.

Referenced by irods::SHA256Strategy::digest(), and packChar().

Here is the call graph for this function:

Variable Documentation

◆ codes

const char* codes
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Definition at line 9 of file base64.cpp.

Referenced by base64_encode().

◆ mymap

const unsigned char mymap[256]
static
Initial value:
= {
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255,
255, 254, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255,
255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255
}

Definition at line 12 of file base64.cpp.

Referenced by base64_decode().