mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
Replacing fastsha256 with crypto/sha256 package from golang standard package (#1584)
This commit is contained in:
committed by
Harshavardhana
parent
b044336329
commit
26e2c4bf4d
@@ -17,6 +17,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
@@ -29,8 +30,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
fastSha256 "github.com/minio/minio/pkg/crypto/sha256"
|
||||
|
||||
mux "github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
@@ -574,7 +573,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
|
||||
|
||||
// Start writing in a routine.
|
||||
go func() {
|
||||
shaWriter := fastSha256.New()
|
||||
shaWriter := sha256.New()
|
||||
multiWriter := io.MultiWriter(shaWriter, writer)
|
||||
if _, cerr := io.CopyN(multiWriter, r.Body, size); cerr != nil {
|
||||
errorIf(cerr, "Unable to read HTTP body.", nil)
|
||||
@@ -719,7 +718,7 @@ func (api objectAPIHandlers) PutObjectPartHandler(w http.ResponseWriter, r *http
|
||||
|
||||
// Start writing in a routine.
|
||||
go func() {
|
||||
shaWriter := fastSha256.New()
|
||||
shaWriter := sha256.New()
|
||||
multiWriter := io.MultiWriter(shaWriter, writer)
|
||||
if _, err = io.CopyN(multiWriter, r.Body, size); err != nil {
|
||||
errorIf(err, "Unable to read HTTP body.", nil)
|
||||
|
||||
Reference in New Issue
Block a user