// NeedsRehash checks if provided hash needs rehash
764908
func (p *Provider) NeedsRehash(hash []byte) bool {
	if !prefixValid(hash) {
		return true
	}

	mcfP := paramsFromMCF(hash[prefixLen:])
	return !p.params.Equals(mcfP)
}
831806
func (_PublicResolver *PublicResolverSession) Contenthash(node [32]byte) ([]byte, error) {
	return _PublicResolver.Contract.Contenthash(&_PublicResolver.CallOpts, node)
}
390790
func Hash(c interface{}, version int) (string, error) {
	return fmt.Sprintf("v%d_%x", version, Md5(c, version)), nil
}
482834
func BytesToHash(b []byte) Hash {
	var h Hash
	h.SetBytes(b)
	return h
}
85532
func (asl *AuthServerLdap) ValidateHash(salt []byte, user string, authResponse []byte, remoteAddr net.Addr) (mysql.Getter, error) {
	panic("unimplemented")
}
931212
func (block *BestBlock) Hash() *chainhash.Hash {
	// Caller should check hash instead of error
	hash, _ := chainhash.NewHashFromStr(block.HashStr())
	return hash
}
555668
func (tc *typCache) needScan(typ reflect.Type) bool {
	return tc.info(typ).needScan
}
71631
func (tx *Transaction) Hash() common.Hash {
	if hash := tx.hash.Load(); hash != nil {
		return hash.(common.Hash)
	}
	v := rlpHash(tx)
	tx.hash.Store(v)
	return v
}
1174866
func MakeHash(newHash []byte) (Hash, error) {
	nhlen := len(newHash)
	if nhlen != HashSize {
		return Hash{}, fmt.Errorf("invalid hash length of %v, want %v",
			nhlen, HashSize)
	}

	var hash Hash
	copy(hash[:], newHash)

	return hash, nil
}
1050181
func (state *UserState) PasswordHash(username string) (string, error) {
	return state.users.Get(username, "password")
}
489960
func NewHash(newHash []byte) (*Hash, error) {
	var sh Hash
	err := sh.SetBytes(newHash)
	if err != nil {
		return nil, err
	}
	return &sh, err
}
439246
func (h *HLL) AddHash(hash uint64) {
	switch h.format {
	case NORMAL:
		h.addNormal(hash)
	case SPARSE:
		h.addSparse(hash)
	}
}
1145639
func DoubleHashH(b []byte) Hash {
	first := sha256.Sum256(b)
	return Hash(sha256.Sum256(first[:]))
}
331610
func Hash(spec *vpython.Spec, rt *vpython.Runtime, extra ...string) string {
	mustMarshal := func(msg proto.Message) []byte {
		data, err := proto.Marshal(msg)
		if err != nil {
			panic(fmt.Errorf("failed to marshal proto: %v", err))
		}
		return data
	}
	specData := mustMarshal(spec)
	rtData := mustMarshal(rt)

	mustWrite := func(v int, err error) {
		if err != nil {
			panic(fmt.Errorf("impossible: %s", err))
		}
	}

	hash := sha256.New()
	for _, s := range extra {
		mustWrite(fmt.Fprintf(hash, "%s:", s))
	}
	mustWrite(fmt.Fprintf(hash, "%s:", vpython.Version))
	mustWrite(hash.Write(specData))
	mustWrite(hash.Write([]byte(":")))
	mustWrite(hash.Write(rtData))
	return hex.EncodeToString(hash.Sum(nil))
}
178288
func (ctx *Context) uniqueHash(v []byte) []byte {
	ctx.uniqueHasher.Reset()
	_, err := ctx.uniqueHasher.Write(v)
	if err != nil {
		// FIXME: libs shouldn't panic
		panic(err)
	}
	return ctx.uniqueHasher.Sum(nil)
}
1085275
func (entry *Entry) FieldsHash(fields []string) string {
	var key []string
	for _, name := range fields {
		value, err := entry.Field(name)
		if err != nil {
			value = "NULL"
		}
		key = append(key, fmt.Sprintf("'%v'=%v", name, value))
	}
	return strings.Join(key, ";")
}
834064
func (auth *Auth) ValidHash(h hash.Hash) bool {
	h.Write([]byte("\n"))
	return bytes.Equal(h.Sum(nil), auth.Hash)
}