// PutHash appends a hash over the buffers current contents to the buffer.
497893
func (e *Encbuf) PutHash(h hash.Hash) {
	h.Reset()
	_, err := h.Write(e.B)
	if err != nil {
		panic(err) // The CRC32 implementation does not error
	}
	e.B = h.Sum(e.B)
}
1067773
func innerHash(left []byte, right []byte) []byte {
	return tmhash.Sum(append(innerPrefix, append(left, right...)...))
}
247715
func (body *Body) Hash() (h string) {
	b := body.Buffer()
	// empty buffs should return a empty string
	if b.Len() == 0 {
		h = HashStr("")
	}
	h = HashStr(b.String())
	return
}
367336
func FastHash(input []byte) string {
	h := fnv.New32a()
	if _, err := h.Write(input); err != nil {
		log.Println("[ERROR] failed to write bytes: ", err)
	}

	return fmt.Sprintf("%x", h.Sum32())
}
740252
func (d *AddressCacheItem) BlockHash() chainhash.Hash {
	d.mtx.RLock()
	defer d.mtx.RUnlock()
	return d.hash
}
24960
func (idx *MemoryIndex) FindHash(o int64) (plumbing.Hash, error) {
	var hash plumbing.Hash
	var ok bool

	if idx.offsetHash != nil {
		if hash, ok = idx.offsetHash[o]; ok {
			return hash, nil
		}
	}

	// Lazily generate the reverse offset/hash map if required.
	if !idx.offsetHashIsFull || idx.offsetHash == nil {
		if err := idx.genOffsetHash(); err != nil {
			return plumbing.ZeroHash, err
		}

		hash, ok = idx.offsetHash[o]
	}

	if !ok {
		return plumbing.ZeroHash, plumbing.ErrObjectNotFound
	}

	return hash, nil
}
1334470
func (tx *Tx) Rehash() []byte {
	hasher := sha256.New()
	hasher.Write(tx.MustSignBytes())
	tx.txHash = hasher.Sum(nil)
	tx.txHash = tx.txHash[:HashLength]
	return tx.txHash
}
1187845
func SealHash(header *types.Header) (hash common.Hash) {
	hasher := sha3.NewLegacyKeccak256()
	encodeSigHeader(hasher, header)
	hasher.Sum(hash[:0])
	return hash
}
545095
func GenerateHash(data []byte) []byte {
	sha := sha1.New()
	sha.Write(data)
	hashBytes := sha.Sum(nil)
	return hashBytes
}
1268820
func (c *Client) PutBucket(ctx context.Context, b *platform.Bucket) error {
	return c.db.Update(func(tx *bolt.Tx) error {
		var err error
		pe := c.putBucket(ctx, tx, b)
		if pe != nil {
			err = pe
		}
		return err
	})
}
871321
func (c *Continuum) Hash(thing []byte) Bucket {
	hash := md5.Sum(thing)

	h := binary.LittleEndian.Uint32(hash[0:4])
	return c.Bucket(h)
}
585060
func NewHash(pos int, line int) *Hash {
	return &Hash{
		NodeType: NodeHash,
		Loc:      Loc{pos, line},
	}
}
1167413
func (s *Section) KeysHash() map[string]string {
	if s.f.BlockMode {
		s.f.lock.RLock()
		defer s.f.lock.RUnlock()
	}

	hash := map[string]string{}
	for key, value := range s.keysHash {
		hash[key] = value
	}
	return hash
}
866196
func (m *HashMap) PutQuiet(key []byte, val interface{}) {
	m.put(key, val, false)
}
265694
func (h *Hashes) Append(hash *Hash) {
	h.hashes = append(h.hashes, hash.hash)
}
917889
func RegisterHash(h Hash, f func() ResumableHash) {
	if h >= maxHash {
		panic("crypto: RegisterHash of unknown hash function")
	}
	hashes[h] = f
}
434080
func Hash(s string) string {
	return fmt.Sprintf("%x", md5.Sum([]byte(s)))
}