[email protected] | f53121d | 2011-03-22 22:11:08 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 4 | |
tfarina | a3116351 | 2015-05-13 22:10:15 | [diff] [blame] | 5 | #ifndef BASE_BASE64_H_ |
6 | #define BASE_BASE64_H_ | ||||
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 7 | |
8 | #include <string> | ||||
9 | |||||
[email protected] | 0bea725 | 2011-08-05 15:34:00 | [diff] [blame] | 10 | #include "base/base_export.h" |
[email protected] | eb62f726 | 2013-03-30 14:29:00 | [diff] [blame] | 11 | #include "base/strings/string_piece.h" |
[email protected] | f53121d | 2011-03-22 22:11:08 | [diff] [blame] | 12 | |
[email protected] | 978df34 | 2009-11-24 06:21:53 | [diff] [blame] | 13 | namespace base { |
[email protected] | a9bb6f69 | 2008-07-30 16:40:10 | [diff] [blame] | 14 | |
georgesak | 85e05a73 | 2014-11-11 17:19:43 | [diff] [blame] | 15 | // Encodes the input string in base64. The encoding can be done in-place. |
[email protected] | 33fca12 | 2013-12-11 01:48:50 | [diff] [blame] | 16 | BASE_EXPORT void Base64Encode(const StringPiece& input, std::string* output); |
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 17 | |
18 | // Decodes the base64 input string. Returns true if successful and false | ||||
georgesak | 85e05a73 | 2014-11-11 17:19:43 | [diff] [blame] | 19 | // otherwise. The output string is only modified if successful. The decoding can |
20 | // be done in-place. | ||||
[email protected] | 0bea725 | 2011-08-05 15:34:00 | [diff] [blame] | 21 | BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output); |
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 22 | |
[email protected] | 978df34 | 2009-11-24 06:21:53 | [diff] [blame] | 23 | } // namespace base |
[email protected] | a9bb6f69 | 2008-07-30 16:40:10 | [diff] [blame] | 24 | |
tfarina | a3116351 | 2015-05-13 22:10:15 | [diff] [blame] | 25 | #endif // BASE_BASE64_H_ |