blob: 43d8f76eb764cc1190612365ea8365cc41ef9edb [file] [log] [blame]
rvargas@google.com7a976cf2011-03-23 07:11:08 +09001// Copyright (c) 2011 The Chromium Authors. All rights reserved.
hayato@chromium.org268ac3a2009-11-24 15:21:53 +09002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_BASE64_H__
6#define BASE_BASE64_H__
hayato@chromium.org268ac3a2009-11-24 15:21:53 +09007
8#include <string>
9
darin@chromium.orge585bed2011-08-06 00:34:00 +090010#include "base/base_export.h"
tfarina@chromium.orgb6d49112013-03-30 23:29:00 +090011#include "base/strings/string_piece.h"
rvargas@google.com7a976cf2011-03-23 07:11:08 +090012
hayato@chromium.org268ac3a2009-11-24 15:21:53 +090013namespace base {
14
vadimt@chromium.org528238b2013-12-11 10:48:50 +090015// Encodes the input string in base64.
16BASE_EXPORT void Base64Encode(const StringPiece& input, std::string* output);
hayato@chromium.org268ac3a2009-11-24 15:21:53 +090017
18// Decodes the base64 input string. Returns true if successful and false
19// otherwise. The output string is only modified if successful.
darin@chromium.orge585bed2011-08-06 00:34:00 +090020BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
hayato@chromium.org268ac3a2009-11-24 15:21:53 +090021
22} // namespace base
23
24#endif // BASE_BASE64_H__