Update to v16.1 documentation and ODK library

This commit is contained in:
Fred Gylys-Colwell
2019-12-13 11:12:54 -08:00
parent 2f232e2939
commit 5b9580a351
19 changed files with 390 additions and 87 deletions

View File

@@ -87,10 +87,12 @@ std::string a2bs_hex(const std::string& byte) {
}
std::string b2a_hex(const std::vector<uint8_t>& byte) {
return HexEncode(&byte[0], byte.size());
if (byte.empty()) return "";
return HexEncode(byte.data(), byte.size());
}
std::string b2a_hex(const std::string& byte) {
if (byte.empty()) return "";
return HexEncode(reinterpret_cast<const uint8_t*>(byte.data()),
byte.length());
}
@@ -251,7 +253,7 @@ std::vector<uint8_t> Base64SafeDecode(const std::string& b64_input) {
std::string HexEncode(const uint8_t* in_buffer, unsigned int size) {
static const char kHexChars[] = "0123456789ABCDEF";
if (size == 0) return "";
// Each input byte creates two output hex characters.
std::string out_buffer(size * 2, '\0');