Hm, that 01 byte seems to be extra somehow. Or there are bytes after
this which are missing.

$ perl -ane 'foreach (@F) { print pack "C", hex($_) }' | protoc --decode_raw
    12 01 40 30 37 62 65 37 36 30 34 32 33 35 32 37
    33 30 64 64 63 37 38 35 39 39 38 39 34 66 31 31
    37 65 30 37 34 35 36 61 37 64 30 37 66 62 36 31
    64 39 38 32 31 62 32 36 61 38 33 34 61 34 30 66
    64 62 38
Failed to parse input.
$ perl -ane 'foreach (@F) { print pack "C", hex($_) }' | protoc --decode_raw
    12 40 30 37 62 65 37 36 30 34 32 33 35 32 37
    33 30 64 64 63 37 38 35 39 39 38 39 34 66 31 31
    37 65 30 37 34 35 36 61 37 64 30 37 66 62 36 31
    64 39 38 32 31 62 32 36 61 38 33 34 61 34 30 66
    64 62 38
2: "07be76042352730ddc78599894f117e07456a7d07fb61d9821b26a834a40fdb8"

On Thu, May 21, 2015 at 6:59 AM, Mason Cubes <codeonw...@gmail.com> wrote:
> I am trying to understand a protobuf encoded message. the message is given
> below, it is apparently a 64 byte long hash value, but I cannot understand
> the encoding process
>
>     12 01 40 30 37 62 65 37 36 30 34 32 33 35 32 37
>     33 30 64 64 63 37 38 35 39 39 38 39 34 66 31 31
>     37 65 30 37 34 35 36 61 37 64 30 37 66 62 36 31
>     64 39 38 32 31 62 32 36 61 38 33 34 61 34 30 66
>     64 62 38
>
>
> The first byte says the following is a byte or string wire type and the
> second byte says only one byte in the byte or string array. Then the third
> byte 0x40 it must be the length of the field i.e 64. If I consider this byte
> as a varint tag content then the rest of the contents does not make sense,
> unless it is a repeated field with integers only 1 byte values all the way
> to the end.
>
> I cannot understand how it was decoded. I don't have the proto file used to
> encode the message.
>
> Can someone give me a hint?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to