开发者

Does metadata alter hash for a file?

We know that hash value for开发者_开发问答 a file is independent of filename. And I did some experiment and it proved that in terms of mac os, the change of label(red,..), keywords, description (in open meta) of a file do not alter hash value.

But the change of metadata in jpeg does change the hash.

So I start to wonder why it holds? Any clue or inspiring tutorial?


The tool that you used apparently hashed what the OS considers as file contents, which in the case of a JPEG includes some metadata defined in the JPEG standard. Keywords, description, etc. are stored outside of the file contents proper by the filesystem.

(What is considered data and what metadata can be rather arbitrary and dependent on the context, e.g. the processing application and platform.)


There are different ways that metadata is stored. For structured storage files created by COM applications, it's embedded directly in the file data. This would change the file's hash if the document properties were changed. On volumes formatted with NTFS 5 (Win2k and later), document properties can be added to any type of file and are stored in alternate data streams. I assume the same is true for the OS X filesystem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜