Google Protocol Buffers in Elixir

I get stuck with using exprotobuf, here is the issue. Someone can help me ?


1 Like

Can you please elaborate further what you have tried?

Please do show some code examples and what they return and what you do expect instead.

Try protox over exprotobuf. I experienced issues with double data type with precision between encoding and on client/recipient end, the decided value suffered precision degradation.

Further, adding, removing fields also resulted in inconsistent state and order.

Solved, Ha, I compared it with a result in hex.

What was it?

So what was it. Do share to make this forum more useful.

1 Like

Even if I do not really understand the original question, but I can explain the solution…

He had an expected “value” of <08 96 01> in an unspecified notation and an actual value of <<8, 150, 1>> in an notation thats unspecified as well, but likely to be elixir/erlang bytestring-syntax. Thats the info from the issue posted at github.

Also he told here, that he “compared it with a result in hex”. So it seems that the expected value was actually <<0x08, 0x96, 0x01>> translated from unspecified syntax into elixir syntax. The first and third byte are obviously the same, while the second one 0x96 needs to be resolved manually or with the help of a computer:

<<0x08, 0x96, 0x01>> === <<8, 150, 1>>
#=> true

So it is like thinking that 1000g are different to 1kg. Well, and thats exactly why my mathteacher and my physics teacher always told me to not forget the units…