Add HashingWriter and HashAppendWriter

This commit is contained in:
Alexander Neumann 2015-02-15 23:21:35 +01:00
parent 5801d9f42f
commit 5c724b92b8
3 changed files with 140 additions and 1 deletions

View file

@ -65,7 +65,7 @@ func TestHashingReader(t *testing.T) {
assert(t, n == int64(size),
"HashAppendReader: invalid number of bytes read: got %d, expected %d",
n, size+len(expectedHash))
n, size)
resultingHash := rd.Sum(nil)
assert(t, bytes.Equal(expectedHash[:], resultingHash),