// tagsHash returns a hash of tag key/value pairs.
161830
func (r *Row) tagsHash() uint64 {
	h := NewInlineFNV64a()
	keys := r.tagsKeys()
	for _, k := range keys {
		h.Write([]byte(k))
		h.Write([]byte(r.Tags[k]))
	}
	return h.Sum64()
}
932643
func MixHash(hash uint32, key uint32) uint32 {
	hash ^= key
	hash = rotateLeft(hash, r2)
	hash = hash*m + n
	return hash

}
873290
func Hash(h crypto.Hash, src io.Reader) (HexDigest, error) {
	a := h.New()
	_, err := io.Copy(a, src)
	if err != nil {
		return HexDigest(""), err
	}
	return Sum(a), nil
}
1291271
func payloadHash(r *http.Request) (string, error) {
	// If the payload is empty, use the empty string as the input to the SHA256 function
	// http://docs.amazonwebservices.com/general/latest/gr/sigv4-create-canonical-request.html
	h := sha256.New()
	var body io.Reader = r.Body
	if r.Body == nil {
		body = ioutil.NopCloser(strings.NewReader(""))
	}
	buf := &bytes.Buffer{}
	reader := io.TeeReader(body, buf)
	io.Copy(h, reader)
	if r.Body != nil {
		r.Body = ioutil.NopCloser(buf)
	}
	return fmt.Sprintf("%x", h.Sum(nil)), nil
}
594592
func hash(parent string) string {
	res := md5.Sum([]byte(parent))
	return string(res[:])
}
232640
func (p *parser) parseHash() *ast.Hash {
	var pairs []*ast.HashPair

	for p.isHashSegment() {
		pairs = append(pairs, p.parseHashSegment())
	}

	firstLoc := pairs[0].Location()

	result := ast.NewHash(firstLoc.Pos, firstLoc.Line)
	result.Pairs = pairs

	return result
}
482834
func BytesToHash(b []byte) Hash {
	var h Hash
	h.SetBytes(b)
	return h
}
1211673
func ComputeHash(template *v1.PodTemplateSpec, collisionCount *int32) string {
	podTemplateSpecHasher := fnv.New32a()
	hashutil.DeepHashObject(podTemplateSpecHasher, *template)

	// Add collisionCount in the hash if it exists.
	if collisionCount != nil {
		collisionCountBytes := make([]byte, 8)
		binary.LittleEndian.PutUint32(collisionCountBytes, uint32(*collisionCount))
		podTemplateSpecHasher.Write(collisionCountBytes)
	}

	return rand.SafeEncodeString(fmt.Sprint(podTemplateSpecHasher.Sum32()))
}
929546
func (txs Txs) Hash() []byte {
	// These allocations will be removed once Txs is switched to [][]byte,
	// ref #2603. This is because golang does not allow type casting slices without unsafe
	txBzs := make([][]byte, len(txs))
	for i := 0; i < len(txs); i++ {
		txBzs[i] = txs[i].Hash()
	}
	return merkle.SimpleHashFromByteSlices(txBzs)
}
434080
func Hash(s string) string {
	return fmt.Sprintf("%x", md5.Sum([]byte(s)))
}
1140915
func hash(data string) string {
	return fmt.Sprintf("%x", sha256.Sum256([]byte(data)))
}
1057869
func (nh *NodeHash) hash(node *UnCompiledNode) int64 {
	// fmt.Println("hash unfrozen")
	h := int64(0)
	for arcIdx := 0; arcIdx < node.NumArcs; arcIdx++ {
		arc := node.Arcs[arcIdx]
		// fmt.Printf("  label=%v target=%v h=%v output=%v isFinal?=%v\n",
		// 	arc.label, arc.Target.(*CompiledNode).node, h,
		// 	nh.fst.outputs.outputToString(arc.output), arc.isFinal)
		h = PRIME*h + int64(arc.label)
		n := arc.Target.(*CompiledNode).node
		h = PRIME*h + int64(n^(n>>32))
		h = PRIME*h + hashPtr(arc.output)
		h = PRIME*h + hashPtr(arc.nextFinalOutput)
		if arc.isFinal {
			h += 17
		}
	}
	// fmt.Printf("  ret %v\n", int32(h))
	return h
}
139011
func (v Var) Hash() int {
	h := xxhash.ChecksumString64S(string(v), hashSeed0)
	return int(h)
}
703315
func (c *Clique) SealHash(header *types.Header) common.Hash {
	return SealHash(header)
}
212019
func PasswordHash(username, password string) string {
	hash := md5.Sum([]byte(strings.ToLower(username) + password))
	return fmt.Sprintf("%x", hash)
}
952120
func (r *queryTable) tagKeys() []string {
	tags := []string{}
	for t := range r.row.Tags {
		tags = append(tags, t)
	}
	sort.Strings(tags)
	return tags
}
1317535
func Hash(certificate *x509.Certificate) string {
	spkiHash := sha256.Sum256(certificate.RawSubjectPublicKeyInfo)
	return formatSHA256 + ":" + strings.ToLower(hex.EncodeToString(spkiHash[:]))
}