blob: dd72c39a239ddfe1d2ccd7f4f072c6611b682d36 [file] [log] [blame]
[email protected]f53121d2011-03-22 22:11:081// Copyright (c) 2011 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit586acc5fe2008-07-26 22:42:524
tfarinaa31163512015-05-13 22:10:155#ifndef BASE_BASE64_H_
6#define BASE_BASE64_H_
initial.commit586acc5fe2008-07-26 22:42:527
8#include <string>
9
[email protected]0bea7252011-08-05 15:34:0010#include "base/base_export.h"
[email protected]eb62f7262013-03-30 14:29:0011#include "base/strings/string_piece.h"
[email protected]f53121d2011-03-22 22:11:0812
[email protected]978df342009-11-24 06:21:5313namespace base {
[email protected]a9bb6f692008-07-30 16:40:1014
georgesak85e05a732014-11-11 17:19:4315// Encodes the input string in base64. The encoding can be done in-place.
[email protected]33fca122013-12-11 01:48:5016BASE_EXPORT void Base64Encode(const StringPiece& input, std::string* output);
initial.commit586acc5fe2008-07-26 22:42:5217
18// Decodes the base64 input string. Returns true if successful and false
georgesak85e05a732014-11-11 17:19:4319// otherwise. The output string is only modified if successful. The decoding can
20// be done in-place.
[email protected]0bea7252011-08-05 15:34:0021BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
initial.commit586acc5fe2008-07-26 22:42:5222
[email protected]978df342009-11-24 06:21:5323} // namespace base
[email protected]a9bb6f692008-07-30 16:40:1024
tfarinaa31163512015-05-13 22:10:1525#endif // BASE_BASE64_H_