Kea
1.5.0
hex.h
Go to the documentation of this file.
1
// Copyright (C) 2009-2016 Internet Systems Consortium, Inc. ("ISC")
2
//
3
// This Source Code Form is subject to the terms of the Mozilla Public
4
// License, v. 2.0. If a copy of the MPL was not distributed with this
5
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
#ifndef HEX_H
8
#define HEX_H 1
9
10
#include <stdint.h>
11
#include <string>
12
#include <vector>
13
14
//
15
// Note: this helper module isn't specific to the DNS protocol per se.
16
// We should probably move this to somewhere else, possibly in some common
17
// utility area.
18
//
19
20
namespace
isc
{
21
namespace
util {
22
namespace
encode {
34
std::string
encodeHex
(
const
std::vector<uint8_t>& binary);
35
47
void
decodeHex
(
const
std::string& input, std::vector<uint8_t>& result);
48
53
inline
std::string
toHex
(std::string value) {
54
std::vector<uint8_t> bin(value.begin(), value.end());
55
return
(
"0x"
+
encodeHex
(bin));
56
}
57
58
}
// namespace encode
59
}
// namespace util
60
}
// namespace isc
61
62
#endif // HEX_H
63
64
// Local Variables:
65
// mode: c++
66
// End:
isc::util::encode::toHex
std::string toHex(std::string value)
Encode in hexadecimal inline.
Definition:
hex.h:53
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition:
agent_parser.cc:144
isc::util::encode::encodeHex
string encodeHex(const vector< uint8_t > &binary)
Encode binary data in the base16 ('hex') format.
Definition:
base_n.cc:461
isc::util::encode::decodeHex
void decodeHex(const string &input, vector< uint8_t > &result)
Decode a text encoded in the base16 ('hex') format into the original data.
Definition:
base_n.cc:466
src
lib
util
encode
hex.h
Generated on Fri Jul 10 2020 09:12:51 for Kea by
1.8.18