chore: 优化计算哈希值方法

This commit is contained in:
tangtanglove
2024-02-20 15:28:50 +08:00
parent d7c81429ad
commit ae5b859832

View File

@@ -235,7 +235,8 @@ func (p *FileSystem) GetFileHash() (string, error) {
)
sha256New := sha256.New()
byteReader := bytes.NewReader(p.File.Content)
byteReader := bytes.NewReader(append(p.File.Content, []byte(p.File.Name)...))
_, err = io.Copy(sha256New, byteReader)
if err != nil {
return hashValue, err