如果在不同语言/体系结构的相同输入上运行,protobuf是否会生成按位的完美副本? [英] Will protobuf generate bitwise perfect copy if ran on the same input on different languages/architectures?
本文介绍了如果在不同语言/体系结构的相同输入上运行,protobuf是否会生成按位的完美副本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我在多个机器(arm,x86,amd64等)上使用相同的 .proto
文件,并且使用以不同语言(c ++,python,java等)编写的实现,在不同配置中进行序列化时,同一条消息会导致完全相同的字节顺序吗?
If I use the same .proto
file, across several machine (arm, x86, amd64 etc.) with implementations written in different languages (c++, python, java, etc.), will the same message result in the exact same byte sequence when serialized across those different configurations?
我想使用这些字节进行哈希处理,以确保同一消息在不同平台上生成时最终会具有完全相同的哈希值.
I would like to use these bytes for hashing to ensure that the same message, when generated on a different platform, would end up with the exact same hash.
推荐答案
通常但并非总是如此"
"Often, but not quite always"
您可能会产生差异的原因包括:
The reasons you might get variance include:
查看全文