Adding streaming sha512

This commit is contained in:
Frederick F. Kautz IV 2015-02-28 15:51:33 -08:00
parent 56bd413a16
commit 90cd8b7b47

View File

@ -175,3 +175,13 @@ func Sum(reader io.Reader) ([]byte, error) {
}
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
}