mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-09-26 20:11:11 +08:00
chore: 优化计算哈希值方法
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user