Better bytes storer to string.

GitOrigin-RevId: fa2b1bd1356f34ddb54ed051e4f963ae5bbdc56c
This commit is contained in:
levlam 2018-04-27 00:49:23 +03:00
parent 4e7b07508f
commit 357ba6640a

View File

@ -219,7 +219,9 @@ class TlStorerToString {
static const char *hex = "0123456789ABCDEF"; static const char *hex = "0123456789ABCDEF";
store_field_begin(name); store_field_begin(name);
result.append("bytes { "); result.append("bytes [");
store_long(static_cast<int64>(value.size()));
result.append("] { ");
for (size_t i = 0; i < value.size(); i++) { for (size_t i = 0; i < value.size(); i++) {
int b = value[static_cast<int>(i)] & 0xff; int b = value[static_cast<int>(i)] & 0xff;
result += hex[b >> 4]; result += hex[b >> 4];