// SetArchiveSHA256TreeHash sets the ArchiveSHA256TreeHash field's value.
168211
func (s *JobDescription) SetArchiveSHA256TreeHash(v string) *JobDescription {
	s.ArchiveSHA256TreeHash = &v
	return s
}
404182
func (tree *MutableTree) Hash() []byte {
	if tree.version > 0 {
		return tree.lastSaved.Hash()
	}
	return nil
}
54098
func (c *ChainIndexer) setSectionHead(section uint64, hash common.Hash) {
	var data [8]byte
	binary.BigEndian.PutUint64(data[:], section)

	c.indexDb.Put(append([]byte("shead"), data[:]...), hash.Bytes())
}
480575
func (s *DescribeVaultOutput) SetNumberOfArchives(v int64) *DescribeVaultOutput {
	s.NumberOfArchives = &v
	return s
}
98906
func (s *InventoryResultItem) SetContentHash(v string) *InventoryResultItem {
	s.ContentHash = &v
	return s
}
93357
func (s *ForgotPasswordInput) SetSecretHash(v string) *ForgotPasswordInput {
	s.SecretHash = &v
	return s
}
1317238
func (s *OutputGroupSettings) SetArchiveGroupSettings(v *ArchiveGroupSettings) *OutputGroupSettings {
	s.ArchiveGroupSettings = v
	return s
}
1297841
func (u *Unit) setPasswordHash(passwordHash string) error {
	ops := []txn.Op{{
		C:      unitsC,
		Id:     u.doc.DocID,
		Assert: notDeadDoc,
		Update: bson.D{{"$set", bson.D{{"passwordhash", passwordHash}}}},
	}}
	err := u.st.db().RunTransaction(ops)
	if err != nil {
		return fmt.Errorf("cannot set password of unit %q: %v", u, onAbort(err, ErrDead))
	}
	u.doc.PasswordHash = passwordHash
	return nil
}
1170390
func (s *Scte35DeliveryRestrictions) SetArchiveAllowedFlag(v string) *Scte35DeliveryRestrictions {
	s.ArchiveAllowedFlag = &v
	return s
}
218158
func (n *node) SetBytes(bucketName string, key interface{}, value []byte) error {
	if key == nil {
		return ErrNilParam
	}

	id, err := toBytes(key, n.codec)
	if err != nil {
		return err
	}

	return n.readWriteTx(func(tx *bolt.Tx) error {
		return n.setBytes(tx, bucketName, id, value)
	})
}
638345
func (s *Set) allowSHA256(hash string) error {
	// validate that the hash is the right length to be a full SHA-256 hash
	hashLength := hex.DecodedLen(len(hash))
	if hashLength != sha256.Size {
		return errors.Errorf("expected a %d byte SHA-256 hash, found %d bytes", sha256.Size, hashLength)
	}

	// validate that the hash is valid hex
	_, err := hex.DecodeString(hash)
	if err != nil {
		return err
	}

	// in the end, just store the original hex string in memory (in lowercase)
	s.sha256Hashes[strings.ToLower(hash)] = true
	return nil
}
186888
func (b *GCSBuilder) AddHash(hash *chainhash.Hash) *GCSBuilder {
	// Do nothing if the builder's already errored out.
	if b.err != nil {
		return b
	}

	return b.AddEntry(hash.CloneBytes())
}
385242
func (s *MaintenanceWindowRunCommandParameters) SetDocumentHash(v string) *MaintenanceWindowRunCommandParameters {
	s.DocumentHash = &v
	return s
}
1218143
func (c *Connection) TreeHashFromMultipartUpload(vault, uploadID string) (string, error) {
	marker := ""
	m := MultiTreeHasher{}
	for {
		parts, err := c.ListMultipartParts(vault, uploadID, marker, 0)
		if err != nil {
			return "", err
		}
		for _, v := range parts.Parts {
			m.Add(v.SHA256TreeHash)
		}
		if parts.Marker == "" {
			break
		}
		marker = parts.Marker
	}
	return m.CreateHash(), nil
}
1159056
func treeHash(nodes [][sha256.Size]byte) [sha256.Size]byte {
	var combine [sha256.Size * 2]byte
	for len(nodes) > 1 {
		for i := 0; i < len(nodes)/2; i++ {
			copy(combine[:sha256.Size], nodes[i*2][:])
			copy(combine[sha256.Size:], nodes[i*2+1][:])
			nodes[i] = sha256.Sum256(combine[:])
		}
		if len(nodes)%2 == 0 {
			nodes = nodes[:len(nodes)/2]
		} else {
			nodes[len(nodes)/2] = nodes[len(nodes)-1]
			nodes = nodes[:len(nodes)/2+1]
		}
	}
	return nodes[0]
}
903568
func (ahf ArchiveHookFunc) DecorateArchive(context map[string]interface{},
	serviceName string,
	zipWriter *zip.Writer,
	awsSession *session.Session,
	noop bool,
	logger *logrus.Logger) error {
	return ahf(context,
		serviceName,
		zipWriter,
		awsSession,
		noop,
		logger)
}
898206
func (th *TreeHash) Reset() {
	th.runningHash.Reset()
	th.remaining = th.remaining[:0]
	th.nodes = th.nodes[:0]
	th.treeHash = [sha256.Size]byte{}
	th.linearHash = [sha256.Size]byte{}
}