Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor file statistics function to use SHA-256 and improve error ha…
…ndling - Replace MD5 hashing with SHA-256 in the FileInfo struct to enhance security and align with best practices against cryptographic vulnerabilities. - Streamlined the file existence and metadata retrieval process by combining the os.Stat call for both checking file existence and retrieving stats, reducing redundancy and potential for errors. - Improved error messages and error wrapping to facilitate better debugging and error tracing, utilizing Go’s %w verb for error formatting. - Updated GoDoc comments to accurately reflect changes in the hashing method from MD5 to SHA-256, ensuring documentation consistency and clarity for future maintenance. This commit secures the file information retrieval by transitioning to a more robust and secure hashing algorithm (SHA-256), and enhances the code’s maintainability and readability through better error management practices.
- Loading branch information