feat: switch upload hash to md5
This commit is contained in:
@@ -2,7 +2,7 @@ package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"io"
|
||||
@@ -196,7 +196,7 @@ func (s *common) CompleteUpload(ctx context.Context, userID int64, form *common_
|
||||
}
|
||||
defer dst.Close()
|
||||
|
||||
hasher := sha256.New()
|
||||
hasher := md5.New()
|
||||
var totalSize int64
|
||||
|
||||
for _, partNum := range parts {
|
||||
@@ -346,7 +346,7 @@ func (s *common) Upload(
|
||||
}
|
||||
|
||||
// Hash calculation while copying
|
||||
hasher := sha256.New()
|
||||
hasher := md5.New()
|
||||
size, err := io.Copy(io.MultiWriter(dst, hasher), src)
|
||||
dst.Close() // Close immediately to allow removal if needed
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user