// WithDigest sets the digest for an image.
8122
func (i *Image) WithDigest(digest digest.Digest) (err error) {
	i.Digest = digest
	i.named, err = reference.WithDigest(i.named, digest)
	return err
}
255822
func newDigest(size int, key []byte) *digest {
	if size != Size && size != Size128 {
		panic("size must be 8 or 16")
	}
	d := new(digest)
	d.k0 = uint64(key[0]) | uint64(key[1])<<8 | uint64(key[2])<<16 | uint64(key[3])<<24 |
		uint64(key[4])<<32 | uint64(key[5])<<40 | uint64(key[6])<<48 | uint64(key[7])<<56
	d.k1 = uint64(key[8]) | uint64(key[9])<<8 | uint64(key[10])<<16 | uint64(key[11])<<24 |
		uint64(key[12])<<32 | uint64(key[13])<<40 | uint64(key[14])<<48 | uint64(key[15])<<56
	d.size = size
	d.Reset()
	return d
}
41988
func WithImage(image string) func(*TestContainerConfig) {
	return func(c *TestContainerConfig) {
		c.Config.Image = image
	}
}
1053209
func WithDigest(name Named, digest digest.Digest) (Canonical, error) {
	if !anchoredDigestRegexp.MatchString(digest.String()) {
		return nil, ErrDigestInvalidFormat
	}
	if tagged, ok := name.(Tagged); ok {
		return reference{
			name:   name.Name(),
			tag:    tagged.Tag(),
			digest: digest,
		}, nil
	}
	return canonicalReference{
		name:   name.Name(),
		digest: digest,
	}, nil
}
982465
func WithDiskSize(size int) ProviderOpts {
	return func(p *Provider) error {
		p.DiskSize = size
		return nil
	}
}
1186047
func (s *GetParametersByPathInput) SetWithDecryption(v bool) *GetParametersByPathInput {
	s.WithDecryption = &v
	return s
}
341750
func WithDecompressor(d grpc.Decompressor) Option {
	return func(o *options) {
		o.decompressor = d
	}
}
137390
func (o *PostIPAMIPFailure) WithPayload(payload models.Error) *PostIPAMIPFailure {
	o.Payload = payload
	return o
}
897238
func (c *CSPRNG) HexDigest(bytes int) (string, error) {
	return hexDigest(c, bytes)
}
487543
func (o *GetAccountDefault) WithPayload(payload *models.Error) *GetAccountDefault {
	o.Payload = payload
	return o
}
1312465
func (s *LayerFailure) SetLayerDigest(v string) *LayerFailure {
	s.LayerDigest = &v
	return s
}
53897
func (o *GetMetricsOK) WithPayload(payload []*models.Metric) *GetMetricsOK {
	o.Payload = payload
	return o
}
255849
func (o *PlaceOrderOK) WithPayload(payload *models.Order) *PlaceOrderOK {
	o.Payload = payload
	return o
}
26094
func NewDigestFromHex(alg, hex string) Digest {
	return Digest(fmt.Sprintf("%s:%s", alg, hex))
}
17354
func NewDigest(chall string) (*Digest, error) {
	c, err := parseChallenge(chall)
	if err != nil {
		return nil, err
	}
	return &Digest{
		Realm:      c.Realm,
		Nonce:      c.Nonce,
		Algorithm:  c.Algorithm,
		Opaque:     c.Opaque,
		Qop:        c.Qop,
		NonceCount: 1,
		m:          &sync.Mutex{},
	}, nil
}
783807
func WithGitInit(ctx context.Context, bv bool) context.Context {
	return context.WithValue(ctx, ctxKeyGitInit, bv)
}
494972
func (f *FakeRNG) HexDigest(bytes int) (string, error) {
	return hexDigest(f, bytes)
}