Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Base64.cc File Reference

Describes base64 namespace, which holds some functions for encoding and decoding base64 data C_Base64 - a simple base64 encoder and decoder. More...

#include "Base64.h"
#include <string>
#include <iostream>
Include dependency graph for Base64.cc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  base64
 

holds some functions for encoding and decoding base64 data


Functions

const string base64::Base64Table ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
 this lookup table defines the base64 encoding
string base64::encode (char buf[], unsigned int len)
 returns a string containing the base64 encoding of len bytes from buf
unsigned int base64::decodeSize (const std::string &data)
 returns the number of bytes which will be decoded from data
char * base64::decode (const std::string &data)
 returns a pointer to a newly allocated region contained the binary data decoded from data
bool base64::decode (const std::string &data, char buf[], unsigned int len)
 decodes data into buf, which you need to provide the size of in len

Variables

static const char base64::fillchar = '='
 used to mark partial words at the end
static const string::size_type base64::np = string::npos
 shorthand for the "no position" return code from string
const string::size_type base64::DecodeTable []
 Decode Table gives the index of any valid base64 character in the Base64 table].

Detailed Description

Describes base64 namespace, which holds some functions for encoding and decoding base64 data C_Base64 - a simple base64 encoder and decoder.

Copyright (c) 1999, Bob Withers - bwit@pobox.com

This code may be freely used for any purpose, either personal or commercial, provided the authors copyright notice remains intact.

Enhancements by Stanley Yamane:

  • reverse lookup table for the decode function
  • reserve string buffer space in advance

Modified by Ethan Tira-Thompson:

  • changed Base64 class to base64 namespace
  • modified functions to work on char[] instead of strings
  • added doxygen commenting
Author:
Bob Withers - bwit@pobox.com (Creator)

Definition in file Base64.cc.


Tekkotsu v5.1CVS
Generated Mon May 9 04:58:53 2016 by Doxygen 1.6.3