// GetTypeHash returns the TypeHash for a given reflect.Type
514400
func GetTypeHash(t reflect.Type) TypeHash {
	if t.Kind() == reflect.Ptr {
		t = t.Elem()
	}

	return TypeHash(fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()))
}
834356
func (c *Client) GetBlockHash(blockHeight int64) (*chainhash.Hash, error) {
	return c.GetBlockHashAsync(blockHeight).Receive()
}
1303326
func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
	var tx *types.Transaction

	// Retrieve a finalized transaction, or a pooled otherwise
	if tx, _, _, _ = rawdb.ReadTransaction(s.b.ChainDb(), hash); tx == nil {
		if tx = s.b.GetPoolTransaction(hash); tx == nil {
			// Transaction not found anywhere, abort
			return nil, nil
		}
	}
	// Serialize to RLP and return
	return rlp.EncodeToBytes(tx)
}
607897
func (lc *LightChain) GetBlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
	number := lc.hc.GetBlockNumber(hash)
	if number == nil {
		return nil, errors.New("unknown block")
	}
	return lc.GetBlock(ctx, hash, *number)
}
1274792
func (tmpl *Template) GetType() TemplateType {
	if tmpl.Container != nil {
		return TemplateTypeContainer
	}
	if tmpl.Steps != nil {
		return TemplateTypeSteps
	}
	if tmpl.DAG != nil {
		return TemplateTypeDAG
	}
	if tmpl.Script != nil {
		return TemplateTypeScript
	}
	if tmpl.Resource != nil {
		return TemplateTypeResource
	}
	if tmpl.Suspend != nil {
		return TemplateTypeSuspend
	}
	return "Unknown"
}
1259493
func (bc *BlockChain) GetHeaderByHash(hash common.Hash) *types.Header {
	return bc.hc.GetHeaderByHash(hash)
}
559943
func (pgb *ChainDB) GetBlockHash(idx int64) (string, error) {
	ctx, cancel := context.WithTimeout(pgb.ctx, pgb.queryTimeout)
	defer cancel()
	hash, err := RetrieveBlockHash(ctx, pgb.db, idx)
	if err != nil {
		log.Errorf("Unable to get block hash for block number %d: %v", idx, err)
		return "", pgb.replaceCancelError(err)
	}
	return hash, nil
}
1072459
func Type(tname string) reflect.Type {
	if t, found := typemap[tname]; found {
		return t
	}
	panic("Type not found: " + tname)
}
519455
func (v *Argument) GetType() (o *Type) {
	if v != nil {
		o = v.Type
	}
	return
}
1315953
func GetTypeName(s spec.Schema) string {
	// Get the reference for complex types
	if IsDefinition(s) {
		_, _, name := GetDefinitionVersionKind(s)
		return name
	}
	// Recurse if type is array
	if IsArray(s) {
		return fmt.Sprintf("%s array", GetTypeName(*s.Items.Schema))
	}
	// Get the value for primitive types
	if len(s.Type) > 0 {
		return fmt.Sprintf("%s", s.Type[0])
	}
	panic(fmt.Errorf("No type found for object %v", s))
}
765148
func (g *GitObject) GetType() string {
	if g == nil || g.Type == nil {
		return ""
	}
	return *g.Type
}
1065166
func (csp *CSP) GetHash(opts bccsp.HashOpts) (h hash.Hash, err error) {
	// Validate arguments
	if opts == nil {
		return nil, errors.New("Invalid opts. It must not be nil.")
	}

	hasher, found := csp.Hashers[reflect.TypeOf(opts)]
	if !found {
		return nil, errors.Errorf("Unsupported 'HashOpt' provided [%v]", opts)
	}

	h, err = hasher.GetHash(opts)
	if err != nil {
		return nil, errors.Wrapf(err, "Failed getting hash function with opts [%v]", opts)
	}

	return
}
733728
func (s *Service) GetConfigByHash(contentHash string) *GetConfigByHashCall {
	c := &GetConfigByHashCall{s: s, urlParams_: make(gensupport.URLParams)}
	c.contentHash = contentHash
	return c
}
789396
func deriveHash_(object string) uint64 {
	var h uint64
	for _, c := range object {
		h = 31*h + uint64(c)
	}
	return h
}
618046
func ObjectRefFromHash(h hash.Hash) *api.ObjectRef {
	typ := reflect.TypeOf(h)
	for algo, props := range supportedAlgos {
		if props.typ == typ {
			return &api.ObjectRef{
				HashAlgo:  api.HashAlgo(algo),
				HexDigest: HexDigest(h),
			}
		}
	}
	panic(fmt.Sprintf("unknown hash algo %T", h))
}
1187845
func SealHash(header *types.Header) (hash common.Hash) {
	hasher := sha3.NewLegacyKeccak256()
	encodeSigHeader(hasher, header)
	hasher.Sum(hash[:0])
	return hash
}
1265641
func (mi *MemoryIndex) GetIndexByHash(h plumbing.Hash) (int, error) {
	i, ok := mi.indexMap[h]
	if ok {
		return i, nil
	}

	return 0, plumbing.ErrObjectNotFound
}