在 Windows 文件系统中,每个文件是否都有预先计算的哈希值?

发布于 2024-08-06 00:10:27 字数 148 浏览 4 评论 0原文

我想通过哈希值搜索重复的文件。出于性能目的,我想知道 NTFS/FAT 文件系统中的每个文件是否存储了哈希/校验和。如果有,我不必计算所有这些来搜索我的文件。

如果有,如何使用.NET访问它?

如果有帮助的话,它将是 JPEG 文件。他们有校验和吗?

I want to search a file duplicate by its hash. For performance purposes I want to know if there is a stored hash/checksum for each file in NTFS/FAT file systems. If there is, I don't have to compute them all to search my file.

If there is, how to access it using .NET?

If it helps, it will be JPEG files. Do they have a checksum?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

高跟鞋的旋律 2024-08-13 00:10:27

没有这样的事情。

There is no such thing.

走走停停 2024-08-13 00:10:27

Windows 不存储每个文件的哈希值。正如 Jader Dias 所建议的,EXE 和 DLL 有校验和,但这些不是您正在寻找的机器人。

请注意,即使您有这样的哈希值,它仍然不能保证唯一性。如果您发现两个文件具有相同的哈希值(和大小),您仍然需要比较内容以确定这些文件是否确实相同。

JPEG 文件可能有一些校验和或哈希值,但您可能也不能指望它们。

Windows does not store a hash for each file. As Jader Dias suggests, there are checksums for EXE's and DLL's but these are not the droids you are looking for.

Note that even if you had such a hash, it still does not guarantee uniqueness. If you found two files with the same hash (and size) you would still have to then compare contents to determine if the files were truly the same.

JPEG files may have some checksums or hashes, but you probably cannot count on them either.

讽刺将军 2024-08-13 00:10:27

Windows 现在确实有搜索功能如果我没记错的话,您可以为其编写自己的插件(换句话说,以自定义方式索引文件)。据推测,您可以为 JPG 和 JPG 编写一个插件。然后只需调用搜索 API 来查找文件(在 Windows 进行索引之后)。

Windows though does have search now & if I recall correctly you can write your own plugins for it (in other words, to index files in a custom way). Presumably, you could write a plugin for JPGs & then simply make search API calls to find files (after Windows does the indexing).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文