local chunk = assert(pb.encode("test_type", { r = 10000000000000001 }))
print(pb.tohex(chunk))
local t = assert(pb.decode("test_type", chunk))
print(Spb(t))
hex:08 81 80 84 FE A6 DE E1 11
print:LUA: {
r = 10000000000000000
} --[[table: 0000026ADFECEE40]]
protoc:load [[ message test_type { optional int64 r = 1; } ]]
local chunk = assert(pb.encode("test_type", { r = 10000000000000001 })) print(pb.tohex(chunk)) local t = assert(pb.decode("test_type", chunk)) print(Spb(t))
hex:08 81 80 84 FE A6 DE E1 11 print:LUA: { r = 10000000000000000 } --[[table: 0000026ADFECEE40]]
encode 10000000000000001 并没有问题,hex是正确的,但decode时为啥是10000000000000000,不支持17位长的int64类型吗?
环境: xlua 2.1.15 lua:5.3 lua-protobuf:最新