code: func (s *Store) ResolveKey(key string) (string, error) {
  	if !strings.HasPrefix(key, hashPrefix) {
  		return "", fmt.Errorf("wrong key prefix")
  	}
  	if len(key) < minlenKey {
  		return "", fmt.Errorf("image ID too short")
  	}
  	if len(key) > lenKey {
  		key = key[:lenKey]
  	}
  
  	var aciInfos []*ACIInfo
  	err := s.db.Do(func(tx *sql.Tx) error {
  		var err error
  		aciInfos, err = GetACIInfosWithKeyPrefix(tx, key)
  		return err
  	})
  	if err != nil {
  		return "", errwrap.Wrap(errors.New("error retrieving ACI Infos"), err)
  	}
  
  	keyCount := len(aciInfos)
  	if keyCount == 0 {
  		return "", ErrKeyNotFound
  	}
  	if keyCount != 1 {
  		return "", fmt.Errorf("ambiguous image ID: %q", key)
  	}
  	return aciInfos[0].BlobKey, nil
  }
docs: // ResolveKey resolves a partial key (of format `sha512-0c45e8c0ab2`) to a full
  // key by considering the key a prefix and using the store for resolution.
  // If the key is longer than the full key length, it is first truncated.