proxygen
Base64.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <string>
13 #include <folly/Range.h>
14 
15 namespace proxygen {
16 
17 // This is a wrapper around openssl base64 encoding. It is a temporary wrapper
18 // around openssl, until a more optimized version lands in folly
19 
20 class Base64 {
21  public:
22  static std::string decode(const std::string& b64message, int padding);
23  static std::string urlDecode(const std::string& b64message);
25  static std::string urlEncode(folly::ByteRange buffer);
26 };
27 
28 }
std::vector< uint8_t > buffer(kBufferSize+16)
static std::string urlEncode(folly::ByteRange buffer)
Definition: Base64.cpp:107
static std::string urlDecode(const std::string &b64message)
Definition: Base64.cpp:26
static std::string decode(const std::string &b64message, int padding)
Definition: Base64.cpp:51
const char * string
Definition: Conv.cpp:212
static std::string encode(folly::ByteRange buffer)
Definition: Base64.cpp:80