func (rv *rollingValueHasher) writeHash(h hash.Hash) {
	digest := h.Digest()
	for _, b := range digest[:] {
		rv.HashByte(b)
	}
}
Exemple #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)
}
Exemple #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
}
Exemple #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
}