// SetChecksum sets the Checksum field's value.
496008
func (s *PutIntentOutput) SetChecksum(v string) *PutIntentOutput {
	s.Checksum = &v
	return s
}
70750
func (s *FieldStats) SetSum(v float64) *FieldStats {
	s.Sum = &v
	return s
}
902704
func (s *BotAliasMetadata) SetChecksum(v string) *BotAliasMetadata {
	s.Checksum = &v
	return s
}
1056824
func (s *PutSlotTypeInput) SetChecksum(v string) *PutSlotTypeInput {
	s.Checksum = &v
	return s
}
898349
func (s *TrustedAdvisorCheckRefreshStatus) SetCheckId(v string) *TrustedAdvisorCheckRefreshStatus {
	s.CheckId = &v
	return s
}
467079
func RemoveChecksum(input Trytes) (Trytes, error) {
	if !guards.IsTrytesOfExactLength(input, HashTrytesSize) &&
		!guards.IsTrytesOfExactLength(input, AddressWithChecksumTrytesSize) {
		return "", ErrInvalidAddress
	}
	return input[:HashTrytesSize], nil
}
972884
func (cr *ChecksumReader) ReadChecksum() ([]byte, error) {
	if cr.datanodes == nil {
		locs := cr.Block.GetLocs()
		datanodes := make([]string, len(locs))
		for i, loc := range locs {
			dn := loc.GetId()
			datanodes[i] = getDatanodeAddress(dn, cr.UseDatanodeHostname)
		}

		cr.datanodes = newDatanodeFailover(datanodes)
	}

	for cr.datanodes.numRemaining() > 0 {
		address := cr.datanodes.next()
		checksum, err := cr.readChecksum(address)
		if err != nil {
			cr.datanodes.recordFailure(err)
			continue
		}

		return checksum, nil
	}

	err := cr.datanodes.lastError()
	if err != nil {
		err = errors.New("No available datanodes for block.")
	}

	return nil, err
}
1210185
func checksum(input []byte) (cksum [4]byte) {
	h := sha256.Sum256(input)
	h2 := sha256.Sum256(h[:])
	copy(cksum[:], h2[:4])
	return
}
80076
func (l *State) SetCheckState(c *CheckState) {
	l.Lock()
	defer l.Unlock()

	l.setCheckStateLocked(c)
}
1227682
func (res *Response) Checksum() string {
	h := sha1.New()
	h.Write(res.Body)
	return strings.ToLower(hex.EncodeToString(h.Sum(nil)))
}
643243
func checksum(buf []byte) uint16 {
	sum32 := checksumDelta(0, buf)
	sum16 := csumConvert32To16bit(sum32)

	csum := ^sum16
	return csum
}
3166
func (s *ArchiveCreationOutput) SetChecksum(v string) *ArchiveCreationOutput {
	s.Checksum = &v
	return s
}
465437
func (s *PutBotAliasOutput) SetChecksum(v string) *PutBotAliasOutput {
	s.Checksum = &v
	return s
}
99783
func checksum(data []byte) ([]byte, error) {
	hash, err := hashDoubleSha256(data)
	if err != nil {
		return nil, err
	}

	return hash[:4], nil
}
760798
func (s *PutIntentInput) SetChecksum(v string) *PutIntentInput {
	s.Checksum = &v
	return s
}
1149684
func verifyChecksum(path, expectedSum string) (bool, error) {
	md5sum, err := checksum(path)
	if err != nil {
		return false, err
	}

	log.Debug("expected MD5 sum:", expectedSum)
	log.Debug("MD5 sum found:", md5sum)

	return expectedSum == md5sum, nil
}
549821
func Checksum(buf []byte, initial uint16) uint16 {
	return calculateChecksum(buf, uint32(initial))
}