共计 190 个字符,预计需要花费 1 分钟才能阅读完成。
// 校验文件 md5 | |
func GetFileMd5(file_path string) string {File, err := os.Open(file_path) | |
if err != nil {return "-----"} | |
defer File.Close() | |
md5h := md5.New() | |
io.Copy(md5h, File) | |
return hex.EncodeToString(md5h.Sum(nil)) | |
} |
正文完