douyan8772 2013-12-11 16:26
浏览 29

为什么重复执行Windows构建会产生不同的校验和?

When I build something with Go on my Mac, the binary has a consistent md5sum for repeated builds. However, when I cross compile for Windows, or build on Windows natively, I get a different checksum each time.

What is happening that causes this?

[kbrandt@glade: ~/] GOOS=windows go build
[kbrandt@glade: ~/] md5 -r tcollector.exe
f66dbec001eb0e02da261b4bc70d8072 tcollector.exe
[kbrandt@glade: ~/] GOOS=windows go build
[kbrandt@glade: ~/] md5 -r tcollector.exe
630e89fa4907b6811a3d19c99dbac2dc tcollector.exe
[kbrandt@glade: ~/] go build             
[kbrandt@glade: ~/] md5 -r tcollector    
0353160b4b000c7ba9d5331a72265291 tcollector
[kbrandt@glade: ~/] go build         
[kbrandt@glade: ~/] md5 -r tcollector
0353160b4b000c7ba9d5331a72265291 tcollector
  • 写回答

2条回答 默认 最新

  • dtc9222 2013-12-11 16:44
    关注

    Something in the output for windows depends on randomness or the time.

    I don't know more than that (like what it is using that changes) but it doesn't matter

    The output generated by compilers (even different versions of the same compiler) will vary and hashes are designed so similar things don't produce similar outputs.

    A checksum is just that, something you can use to check you have the file and it is correct.

    A bit of a null answer but there's no technical problem with what you are seeing happening.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大