Merge pull request #221 from fkautz/pr_out_adding_streaming_sha512
This commit is contained in:
commit
9744efc725
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue