// GetSHA returns the SHA field if it's non-nil, zero value otherwise.
334929
func (r *RepositoryContent) GetSHA() string {
	if r == nil || r.SHA == nil {
		return ""
	}
	return *r.SHA
}
327305
func makeHA1(realm, username, password string, algorithm digestAlgorithm) string {
	A1 := fmt.Sprintf("%s:%s:%s", username, realm, password)
	return hash([]byte(A1), algorithm)
}
341270
func (vm *VM) GetSSH(options ssh.Options) (ssh.Client, error) {

	ips, err := util.GetVMIPs(vm, options)
	if err != nil {
		return nil, err
	}

	client := &ssh.SSHClient{
		Creds:   &vm.SSHCreds,
		IP:      ips[0], // public IP
		Options: options,
		Port:    22,
	}
	if err := client.WaitForSSH(SSHTimeout); err != nil {
		return nil, err
	}

	return client, nil

}
1246407
func (p *requiredProperty) getHashKey() ([]byte, error) {
	datums := make([]types.Datum, 0, len(p.props)*3+1)
	datums = append(datums, types.NewDatum(p.sortKeyLen))
	for _, c := range p.props {
		datums = append(datums, types.NewDatum(c.desc), types.NewDatum(c.col.FromID), types.NewDatum(c.col.Index))
	}
	bytes, err := codec.EncodeValue(nil, datums...)
	return bytes, errors.Trace(err)
}
893071
func (r *RepositoryCommit) GetSHA() string {
	if r == nil || r.SHA == nil {
		return ""
	}
	return *r.SHA
}
1139013
func (ts *Store) GetImageHash(id string) (string, error) {
	treepath := ts.GetPath(id)

	imgHash, err := ioutil.ReadFile(filepath.Join(treepath, imagefilename))
	if err != nil {
		return "", errwrap.Wrap(errors.New("cannot read image file"), err)
	}

	return string(imgHash), nil
}
273271
func (h *Hashes) Get(index int) (hash *Hash, _ error) {
	if index < 0 || index >= len(h.hashes) {
		return nil, errors.New("index out of bounds")
	}
	return &Hash{h.hashes[index]}, nil
}
1070488
func (c *CommitFile) GetSHA() string {
	if c == nil || c.SHA == nil {
		return ""
	}
	return *c.SHA
}
205962
func (t *Transaction) RetrieveHash(ns string, coll string) []byte {
	if t.RWSet == nil {
		return nil
	}
	for _, nsData := range t.RWSet.NsRwSets {
		if nsData.NameSpace != ns {
			continue
		}

		for _, collData := range nsData.CollHashedRwSets {
			if collData.CollectionName == coll {
				return collData.PvtRwSetHash
			}
		}
	}
	return nil
}
109206
func (m *nativeGitClient) CommitSHA() (string, error) {
	out, err := m.runCmd("git", "rev-parse", "HEAD")
	if err != nil {
		return "", err
	}
	return strings.TrimSpace(out), nil
}
133688
func (hs Headers) Get(name string) Value {
	for i := 0; i < len(hs); i++ {
		if h := hs[i]; h.Name == name {
			return h.Value
		}
	}
	return nil
}
391231
func (cr *Context) GetDash(dashes, offset *float64) {
	C.cairo_get_dash(cr.Ptr, (*C.double)(unsafe.Pointer(dashes)), (*C.double)(unsafe.Pointer(offset)))
	if err := cr.status(); err != nil {
		panic(err)
	}
}
1372722
func (h *Hash) Get(key Value) (*MrbValue, error) {
	keyVal := key.MrbValue(&Mrb{h.state}).value
	result := C.mrb_hash_get(h.state, h.value, keyVal)
	return newValue(h.state, result), nil
}
190073
func (u *UpdateCheckRunOptions) GetHeadSHA() string {
	if u == nil || u.HeadSHA == nil {
		return ""
	}
	return *u.HeadSHA
}
464691
func (s *NeutrinoClient) GetBlockHash(height int64) (*chainhash.Hash, error) {
	return s.CS.GetBlockHash(height)
}
803448
func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
	if sha == "" {
		return nil, ErrAccessTokenEmpty{}
	}
	t := &AccessToken{Sha1: sha}
	has, err := x.Get(t)
	if err != nil {
		return nil, err
	} else if !has {
		return nil, ErrAccessTokenNotExist{sha}
	}
	return t, nil
}
642139
func getHMacSha512(message, secret []byte) []byte {
	mac := hmac.New(sha512.New, secret)
	mac.Write(message)
	return mac.Sum(nil)
}