Functions
base64Decoder.h File Reference

This library provides functions to convert a base64 encoded value to 32bit signed/unsigned integer. More...

#include <vector>
#include <string>
Include dependency graph for base64Decoder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

long base64_decode (const std::string &in, const unsigned int startByteIndex, const unsigned int endByteIndex, const unsigned int size, bool isSigned)
 Function decodes a Base64 string and returns the decoded string (or only parts of it) up to a maximum of 8 byte signed/unsigned data types wrapped in an int64 return value. More...
 
std::vector< unsigned char > base64_to_binary (const std::string &in)
 Decodes a base64 encoded string to bytes. More...
 
long convertValue (const unsigned long value, const unsigned int size, bool isSigned)
 Converts a 32bit signed/unsigned integer from its bit representation to signed 64bit integer. More...
 
unsigned long getValueAt (std::vector< unsigned char > &bytes, const unsigned int startByteIndex, const unsigned int endByteIndex)
 Concatenates bytes from index a to index b of a byte array. More...
 

Detailed Description

This library provides functions to convert a base64 encoded value to 32bit signed/unsigned integer.

Definition in file base64Decoder.h.

Function Documentation

long base64_decode ( const std::string &  in,
const unsigned int  startByteIndex,
const unsigned int  endByteIndex,
const unsigned int  size,
bool  isSigned 
)
inline

Function decodes a Base64 string and returns the decoded string (or only parts of it) up to a maximum of 8 byte signed/unsigned data types wrapped in an int64 return value.

This Fuction decodes a Base64 string and returns a specific byte or multiple bytes at the given indices, where this information is converted as a desired datatype and returned as int64. Example for decoding a Base64 string, getting the second byte, reading this value as an int16: base64_decode("Afb/", 1, 2, 16, true).

Parameters
[in]ininput Base64 string.
[in]startByteIndexindex number (starting with zero) of the first byte of the value that has to be read.
[in]endByteIndexindex number (starting with zero) of the last byte of the value that has to be read.
[in]sizesize in bits of the value that is to be read from the decoded string.
[in]isSignedwhether the value from the decoded string is to be read as signed or unsigned.
Returns
Decoded information as an int64.

Definition at line 134 of file base64Decoder.h.

std::vector<unsigned char> base64_to_binary ( const std::string &  in)
inline

Decodes a base64 encoded string to bytes.

Parameters
[in]ininput string to be decoded
Returns
byte array decoded from the input string
Author
azawadzki - from: https://stackoverflow.com/questions/180947/base64-decode-snippet-in-c

Definition at line 18 of file base64Decoder.h.

long convertValue ( const unsigned long  value,
const unsigned int  size,
bool  isSigned 
)
inline

Converts a 32bit signed/unsigned integer from its bit representation to signed 64bit integer.

Parameters
[in]valueinput number encoded in 64 bits
[in]sizebyte size the output is supposed to have
[in]isSignedshould the output be signed or unsigned?
Returns
output signed/unsigned 32bit integer inside a signed 64bit integer

Definition at line 91 of file base64Decoder.h.

unsigned long getValueAt ( std::vector< unsigned char > &  bytes,
const unsigned int  startByteIndex,
const unsigned int  endByteIndex 
)
inline

Concatenates bytes from index a to index b of a byte array.

Parameters
[in]bytesbyte array
[in]startByteIndexstart index a
[in]endByteIndexend index b
Returns
unsigned 64bit integer containing the concatenated bytes

Definition at line 68 of file base64Decoder.h.



pses_ucbridge
Author(s): Sebastian Ehmes
autogenerated on Sat Oct 28 2017 19:16:13