0

I am currently trying to create a scan system, which identifies files that have been modified since the previous scan.

It will work on some directories/files and identify the content which have been changed.

I am planning to use Hashing as a mechanism to find modification in files/folders.

Hash functions tend to work on content of the file/folder for computation of its hash. But i am not quite sure about it. Since some modified hashing algorithms also take into account the metadata of the file while computing its hash.

So I just want to know that does hashing takes into account the content of the file only, or even its metadata?

And is my way of identifying changes in file good enough, or there exists an improvement too?

2

Hash algorithms have no idea of files or meta data, they just work on bits and bytes. This means you can write a program which only works on the files content, a program which takes also meta data into account, a program which ignores every other byte of the files content ... - it all depends on which bytes you feed into the hash function. Common command line utilities like md5sum just work on the bytes of the content and don't care about meta data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.