// Key returns the unique identifier for a VserverEntry.
7121
func (v *VserverEntry) Key() string {
	return fmt.Sprintf("%d/%s", v.Port, v.Proto)
}
635359
func PrimaryKey(src interface{}) (name string, pk int64, err error) {
	return Default.PrimaryKey(src)
}
926595
func (g *GPG) FormatKey(ctx context.Context, id string) string {
	ent := g.findEntity(id)
	if ent == nil || ent.Identities == nil {
		return ""
	}
	for name := range ent.Identities {
		return name
	}
	return ""
}
741135
func (mr *modelRef) key() string {
	return mr.spec.name + ":" + mr.model.ModelID()
}
1075293
func (trust *NotarySigner) AddKey(role data.RoleName, gun data.GUN, k data.PrivateKey) error {
	return errors.New("Adding a key to NotarySigner is not supported")
}
789465
func (c *TokenController) Keys(ctx *app.KeysTokenContext) error {
	var publicKeys token.JSONKeys
	if ctx.Format != nil && *ctx.Format == "pem" {
		publicKeys = c.TokenManager.PemKeys()
	} else {
		publicKeys = c.TokenManager.JSONWebKeys()
	}

	return ctx.OK(&app.PublicKeys{Keys: publicKeys.Keys})
}
1000924
func (t *tableCommon) RecordKey(h int64) kv.Key {
	return tablecodec.EncodeRecordKey(t.recordPrefix, h)
}
810671
func (s *xorKeySpace) Key(id []byte) Key {
	hash := sha256.Sum256(id)
	key := hash[:]
	return Key{
		Space:    s,
		Original: id,
		Bytes:    key,
	}
}
137514
func (c *Cache) entryKey(t string, r *RequestInfo) string {
	return fmt.Sprintf("%s/%s/%s/%s", t, r.Datacenter, r.Token, r.Key)
}
785730
func (c *keyValueChanger) Key() (string, error) {
	if c.err != nil {
		return "", c.err
	}
	return c.node.content.key().(string), nil
}
368857
func (m *Mapping) key() mappingKey {
	// Normalize addresses to handle address space randomization.
	// Round up to next 4K boundary to avoid minor discrepancies.
	const mapsizeRounding = 0x1000

	size := m.Limit - m.Start
	size = size + mapsizeRounding - 1
	size = size - (size % mapsizeRounding)
	key := mappingKey{
		size:   size,
		offset: m.Offset,
	}

	switch {
	case m.BuildID != "":
		key.buildIDOrFile = m.BuildID
	case m.File != "":
		key.buildIDOrFile = m.File
	default:
		// A mapping containing neither build ID nor file name is a fake mapping. A
		// key with empty buildIDOrFile is used for fake mappings so that they are
		// treated as the same mapping during merging.
	}
	return key
}
307189
func nodeKey(id ID) []byte {
	key := append([]byte(dbNodePrefix), id[:]...)
	key = append(key, ':')
	key = append(key, dbDiscoverRoot...)
	return key
}
850934
func NewKey(namespace string, setName string, key interface{}) (*Key, error) {
	newKey := &Key{
		namespace: namespace,
		setName:   setName,
		userKey:   NewValue(key),
	}

	if err := newKey.computeDigest(); err != nil {
		return nil, err
	}

	return newKey, nil
}
543215
func (enc *Encoder) AddInterfaceKey(key string, value interface{}) {
	switch vt := value.(type) {
	case string:
		enc.AddStringKey(key, vt)
	case bool:
		enc.AddBoolKey(key, vt)
	case MarshalerJSONArray:
		enc.AddArrayKey(key, vt)
	case MarshalerJSONObject:
		enc.AddObjectKey(key, vt)
	case int:
		enc.AddIntKey(key, vt)
	case int64:
		enc.AddIntKey(key, int(vt))
	case int32:
		enc.AddIntKey(key, int(vt))
	case int16:
		enc.AddIntKey(key, int(vt))
	case int8:
		enc.AddIntKey(key, int(vt))
	case uint64:
		enc.AddIntKey(key, int(vt))
	case uint32:
		enc.AddIntKey(key, int(vt))
	case uint16:
		enc.AddIntKey(key, int(vt))
	case uint8:
		enc.AddIntKey(key, int(vt))
	case float64:
		enc.AddFloatKey(key, vt)
	case float32:
		enc.AddFloat32Key(key, vt)
	default:
		if vt != nil {
			enc.err = InvalidMarshalError(fmt.Sprintf(invalidMarshalErrorMsg, vt))
			return
		}
		return
	}
}
229453
func key(m *dns.Msg, t response.Type, do bool) int {
	// We don't store truncated responses.
	if m.Truncated {
		return -1
	}
	// Nor errors or Meta or Update
	if t == response.OtherError || t == response.Meta || t == response.Update {
		return -1
	}

	return int(hash(m.Question[0].Name, m.Question[0].Qtype, do))
}
483377
func (ep *endpoint) Key() []string {
	if ep.network == nil {
		return nil
	}

	return []string{datastore.EndpointKeyPrefix, ep.network.id, ep.id}
}
878472
func (info ClientHelloInfo) Key() string {
	extensions, compressionMethods := "?", "?"
	if !info.ExtensionsUnknown {
		extensions = fmt.Sprintf("%x", info.Extensions)
	}
	if !info.CompressionMethodsUnknown {
		compressionMethods = fmt.Sprintf("%x", info.CompressionMethods)
	}
	return telemetry.FastHash([]byte(fmt.Sprintf("%x-%x-%s-%s-%x-%x",
		info.Version, info.CipherSuites, extensions,
		compressionMethods, info.Curves, info.Points)))
}