forked from csumathdyj/libdigest-hmac-sha256-cxx11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mime-base16.hpp
26 lines (19 loc) · 869 Bytes
/
mime-base16.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <string>
namespace mime {
// RFC 4648 <http://tools.ietf.org/html/rfc4648>
// 8. Base 16 Encoding
// The Base 16 Alphabet is uppercase.
//std::string encode_base16 (std::string const& in);
std::string encode_base16 (std::string const& in,
std::string const& endline = "\n", int const width = 76);
bool decode_base16 (std::string const& str16, std::string& octets);
// (not in RFC) lowercase version for cipher/digest text
std::string encode_hex (std::string const& in,
std::string const& endline = "", int const width = 76);
bool decode_hex (std::string const& str16, std::string& octets);
std::string encode_base16basic (std::string const& in, std::string const& b16,
std::string const& endline, int const width);
bool decode_base16basic (std::string const& str16, std::string& octets,
int const *c16);
}// namespace mime