Answer the question
In order to leave comments, you need to log in
How to get a checksum for a folder?
Good afternoon! please tell me some quick example for calculating the checksum in c# for a folder. I tried to calculate the checksum for the files inside the folder, but since the files take a lot of time. Is there any quick way to find out the checksum of the entire folder at once in order to quickly compare it with the known one and, if necessary, then recalculate it for files.
Answer the question
In order to leave comments, you need to log in
It all depends on the degree of "uniqueness" of folders.
You can suggest the following way:
Take the names of the files, their sizes and modification dates.
Sort them by filename.
Add it to one file/line and count the hash.
This will work under certain assumptions: that you do not have an attacker who will change the contents of files without changing their size and modification date.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question