mirror of
https://github.com/minio/minio.git
synced 2024-12-26 23:25:54 -05:00
Adding streaming sha512
This commit is contained in:
parent
56bd413a16
commit
90cd8b7b47
@ -175,3 +175,13 @@ func Sum(reader io.Reader) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
return h.Sum(nil), nil
|
return h.Sum(nil), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SumStream(reader io.Reader) ([Size]byte, error) {
|
||||||
|
var returnValue [Size]byte
|
||||||
|
sumSlice, err := Sum(reader)
|
||||||
|
if err != nil {
|
||||||
|
return returnValue, err
|
||||||
|
}
|
||||||
|
copy(returnValue[:], sumSlice)
|
||||||
|
return returnValue, err
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user