I use the following prototype :

message Find {
   required uint64 tag = 1;
   required Common.Hash peerID = 2;
   required string pattern = 3;


   Protos::Core::Find findProto;

(findProto.tag() == 9999) is true.

findProto.DebugString() return

  tag: 9999
  peerID {
    hash: "323655354"
  pattern: "coucou"

Great isn't it ?

But now, if I serialize and unserialize the prototype

      std::string output;

      Protos::Core::Find findMessage;

What do I get ?

  tag: 30064781071
  peerID {
    hash: "323655354"
  pattern: "coucou"

Why my tag changed oO ? It's not a random value, and it's works for
small numbers.

I tried to change the type of tag to uint32, int32, etc. always the
same problem.

Thanks for your help,
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to