Merge pull request #221 from fkautz/pr_out_adding_streaming_sha512

This commit is contained in:
Frederick F. Kautz IV 2015-02-28 15:52:10 -08:00
commit 9744efc725
1 changed files with 10 additions and 0 deletions

View File

@ -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
}