File: base64.h

package info (click to toggle)
kdenetwork 4%3A4.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 45,248 kB
  • sloc: cpp: 305,470; ansic: 50,902; xml: 2,141; lex: 1,735; python: 290; sh: 287; perl: 125; tcl: 49; makefile: 29; ruby: 28
file content (32 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32

//*********************************************************************
//* 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.
//*********************************************************************

#ifndef TALK_BASE_BASE64_H__
#define TALK_BASE_BASE64_H__

#include <string>

namespace talk_base {

class Base64
{
public:
  static std::string encode(const std::string & data);
  static std::string decode(const std::string & data);
  static std::string encodeFromArray(const char * data, size_t len);
private:
  static const std::string Base64Table;
  static const std::string::size_type DecodeTable[];
};

} // namespace talk_base

#endif // TALK_BASE_BASE64_H__