Re: [protobuf] Variable-Width Integer Encoding

2018-01-03 Thread Ilia Mirkin
I doubt you're going to get a nice clean answer. Chances are it's "whatever Sanjay was thinking at the time" which led to the current encoding, maintained throughout the proto versions for backwards compatibility with existing data. While APIs have changed over time, the wire encoding has remained

[protobuf] I want to parse binary string into message c++

2018-01-03 Thread 정등혁
#include #include #include #include "EncodeMessage.pb.h" using namespace std; string HexString2BinaryString(string sHex) { string sReturn = ""; int sLen = sHex.length(); for (int i = 0; i < sLen; ++i) { switch (sHex[i]) { case '0': sReturn.append(""); break; case '1':