func (rv *rollingValueHasher) writeHash(h hash.Hash) {
	digest := h.Digest()
	for _, b := range digest[:] {
		rv.HashByte(b)
	}
}
Beispiel #2
0
func serializeHash(w io.Writer, h hash.Hash) {
	digest := h.Digest()
	n, err := io.Copy(w, bytes.NewReader(digest[:]))
	d.Chk.NoError(err)
	d.Chk.True(int64(hash.ByteLen) == n)
}
Beispiel #3
0
func (b *binaryNomsWriter) writeHash(h hash.Hash) {
	b.ensureCapacity(sha1.Size)
	digest := h.Digest()
	copy(b.buff[b.offset:], digest[:])
	b.offset += sha1.Size
}
Beispiel #4
0
func (b *binaryNomsWriter) writeHash(h hash.Hash) {
	b.ensureCapacity(hash.ByteLen)
	digest := h.Digest()
	copy(b.buff[b.offset:], digest[:])
	b.offset += hash.ByteLen
}