Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: components/base32/base32.h

Issue 2017123002: Adds a base32 component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_BASE32_BASE32_H_
6 #define COMPONENTS_BASE32_BASE32_H_
7
8 #include <string>
9
10 #include "base/strings/string_piece.h"
11
12 namespace base32 {
13
14 enum class Base32EncodePolicy {
15 // Include the trailing padding in the output, when necessary.
16 INCLUDE_PADDING,
17 // Remove the trailing padding from the output.
gab 2016/06/03 18:46:11 // Omit trailing padding to the output. Such an ou
Rob Percival 2016/06/04 06:20:25 That isn't quite accurate. It is decodable, if you
gab 2016/06/07 01:24:10 Your latest version lg to me.
18 OMIT_PADDING
19 };
20
21 // Encodes the |input| string in base32, defined in RFC 4648:
22 // https://tools.ietf.org/html/rfc4648#section-5
23 //
24 // The |policy| defines whether padding should be included or omitted from the
25 // encoded output.
26 std::string Base32Encode(
27 base::StringPiece input,
28 Base32EncodePolicy policy = Base32EncodePolicy::INCLUDE_PADDING);
29
30 } // namespace base32
31
32 #endif // COMPONENTS_BASE32_BASE32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698