func gethash(path string) (hash string) {
file, _ := os.Open(path)
h_ob := sha256.New()
_, err := io.Copy(h_ob, file)
if err == nil {
hash := h_ob.Sum(nil)
hashvalue := hex.EncodeToString(hash)
return hashvalue
} else {
return "哈希错误"
}
}
09-14
1074
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-30
1047
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-11