protobuf.js version: v6.6.4
When deserializing sfixed64 values, the Long object returned contains data that is smaller by a factor of 2.
I've compared v5.0.2 results with v6.6.4.
- Identical base 64 input
- output of
Long values is different by a factor of 2
v6.6.4
const pbEntity = pbRoot.lookup(schema);
const buffer = Buffer.from(base64Data, 'base64');
const entity = pbEntity.decode(buffer).toObject({ bytes: String, enums: String, arrays: true });
v5.0.2
const entity = protoBufBuilder.build(schema).decode(base64Data).toRaw(true);
When I removed the zzDecode call, I got correct results:
function read_sfixed64_long() {
return readFixed64.call(this).toLong();
}
instead of:
function read_sfixed64_long() {
return readFixed64.call(this).zzDecode().toLong();
}
I think that the implementation might need to be identical to fixed64.
If needed, I can write some code to repro the problem in isolation.
protobuf.js version: v6.6.4
When deserializing sfixed64 values, the
Longobject returned contains data that is smaller by a factor of 2.I've compared v5.0.2 results with v6.6.4.
Longvalues is different by a factor of 2v6.6.4
v5.0.2
When I removed the
zzDecodecall, I got correct results:instead of:
I think that the implementation might need to be identical to
fixed64.If needed, I can write some code to repro the problem in isolation.