Updated FAQ: Standard file comparison VS hash file comparison (markdown)

xfarrow 2023-04-29 13:53:35 +00:00
parent bfa2327141
commit d8750332cd
2 changed files with 9 additions and 3 deletions

9
FAQ.md Normal file

@ -0,0 +1,9 @@
# "Frequently Asked" Questions
## Standard file comparison VS hash file comparison
When checking whether two files are equal or not, by default dircomp compares their content (in bytes). By enabling option `-d` dircomp compares the SHA-1 hash of the files.
As anyone can guess, a direct comparison is faster than computing an hash (which requires the files to be fully read anyways) plus comparing the result of said hash, so why creating this functionality in the first place?
* If one wants to be extra sure of the correctness of the output of this program, they may execute a comparison by digest too;
* I'd like to implement more functionalities which require a digest computation. I already had the knowledge to compute the SHA-1 of a file so I decided to insert the relative functions in the source.
* Perhaps one could be interested in obtaining the hash of the files that are being processed? This is not supported, but they'd be few lines away from obtaining what they need.

@ -1,3 +0,0 @@
When checking whether two files are equal or not, by default dircomp compares their content (in bytes). By enabling option `-d` dircomp compares the SHA-1 hash of the files.
As anyone can guess, a direct comparison is faster than computing an hash (which requires the files to be fully read anyways) plus comparing the result of said hash, so why creating this functionality in the first place? I'd like to implement more functionalities which require a digest computation. I already had the knowledge to compute the SHA-1 of a file so I decided to insert the relative functions in the source. Furthermore one could be interested in obtaining also the hash of the files? Then they'd be few lines away from obtaining what they need.