I have a go project names hello which contains only a main.go
source file.
I use go build
to get an executable called hello
, then md5sum hello
to get its md5:9d51bcdbddd40320ba3057f91952865e
. Then I use tar cvf hello.tar hello
to get hello.tar
and calculate its md5:63fda573908ec8c1bfa58ac46419efbe
.
Next, I rm hello hello.tar
and redo the things above:
hello
md5: 9d51bcdbddd40320ba3057f91952865e (still the same)
hello.tar
md5: 880dea1e12e5c69b24b83cf13db6606b (changed)
I'v already learned that if I use tar czf
command, the md5 will surely change because of the timestamps in the archives are changed. But why tar cf
also changes the md5?
refer: reference link