// AddChecksums is a wrapper function around AddChecksum for multiple trytes strings.
500264
func AddChecksums(inputs []Trytes, isAddress bool, checksumLength uint64) ([]Trytes, error) {
	withChecksums := make([]Trytes, len(inputs))
	for i, s := range inputs {
		t, err := AddChecksum(s, isAddress, checksumLength)
		if err != nil {
			return nil, err
		}
		withChecksums[i] = t
	}
	return withChecksums, nil
}
742484
func NewChecksumWriter() *ChecksumWriter {
	return &ChecksumWriter{
		hashes: []hash.Hash{md5.New(), sha1.New(), sha256.New()},
	}
}
1154256
func (l *State) AddCheck(check *structs.HealthCheck, token string) error {
	l.Lock()
	defer l.Unlock()

	return l.addCheckLocked(check, token)
}
103569
func (u *Update) VerifyChecksum(checksum []byte) *Update {
	u.Checksum = checksum
	return u
}
1014630
func (l *State) AddServiceWithChecks(service *structs.NodeService, checks []*structs.HealthCheck, token string) error {
	l.Lock()
	defer l.Unlock()

	if err := l.addServiceLocked(service, token); err != nil {
		return err
	}

	for _, check := range checks {
		if err := l.addCheckLocked(check, token); err != nil {
			return err
		}
	}

	return nil
}
402443
func (m *Manifest) RunChecksums() []error {
	var invalidSums []error

	for key, sum := range m.Data {
		pathToFile := filepath.Join(filepath.Dir(m.name), key)
		fileChecksum, err := bagutil.FileChecksum(pathToFile, m.hashFunc())
		if sum != fileChecksum {
			invalidSums = append(invalidSums, fmt.Errorf("File checksum %s is not valid for %s:%s", sum, key, fileChecksum))
		}
		if err != nil {
			invalidSums = append(invalidSums, err)
		}
	}

	return invalidSums
}
1300120
func (h *Health) AddChecks(cfgs []*Config) error {
	if h.active.val() {
		return ErrNoAddCfgWhenActive
	}

	h.configs = append(h.configs, cfgs...)

	return nil
}
1100163
func (p *Enforcer) AddCheck(name string, c Check) {
	p.checks[name] = c
}
1257410
func (s *GetIntentOutput) SetChecksum(v string) *GetIntentOutput {
	s.Checksum = &v
	return s
}
742859
func (r *Application) AddHealthCheck(healthCheck HealthCheck) *Application {
	if r.HealthChecks == nil {
		r.EmptyHealthChecks()
	}

	healthChecks := *r.HealthChecks
	healthChecks = append(healthChecks, healthCheck)
	r.HealthChecks = &healthChecks

	return r
}
311610
func (s *CreateSlotTypeVersionInput) SetChecksum(v string) *CreateSlotTypeVersionInput {
	s.Checksum = &v
	return s
}
549821
func Checksum(buf []byte, initial uint16) uint16 {
	return calculateChecksum(buf, uint32(initial))
}
785025
func Checksum(address Hash) (Trytes, error) {
	if len(address) < 81 {
		return "", ErrInvalidAddress
	}

	addressWithChecksum, err := checksum.AddChecksum(address[:81], true, 9)
	if err != nil {
		return "", err
	}
	return addressWithChecksum[AddressWithChecksumTrytesSize-AddressChecksumTrytesSize : 90], nil
}
330863
func xorChecksum(s string) string {
	var checksum uint8
	for i := 0; i < len(s); i++ {
		checksum ^= s[i]
	}
	return fmt.Sprintf("%02X", checksum)
}
288567
func (f *Form) AddCheckbox(label string, checked bool, changed func(checked bool)) *Form {
	f.items = append(f.items, NewCheckbox().
		SetLabel(label).
		SetChecked(checked).
		SetChangedFunc(changed))
	return f
}
176189
func (h *Handler) Add(c Checker) {
	h.checkers = append(h.checkers, c)
}
361011
func (s *CreateBotVersionInput) SetChecksum(v string) *CreateBotVersionInput {
	s.Checksum = &v
	return s
}