MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / HashRedact

Method HashRedact

db/document.go:189–195  ·  view source on GitHub ↗

HashRedact does in-place redaction of UserData inside GlobalSyncData, by hashing attachment names.

(salt string)

Source from the content-addressed store, hash-verified

187
188// HashRedact does in-place redaction of UserData inside GlobalSyncData, by hashing attachment names.
189func (gsd *GlobalSyncData) HashRedact(salt string) error {
190 for k, v := range gsd.Attachments {
191 gsd.Attachments[base.Sha1HashString(k, salt)] = v
192 delete(gsd.Attachments, k)
193 }
194 return nil
195}
196
197// RedactRawSyncData runs HashRedact on the given sync data.
198func RedactRawSyncData(syncData []byte, redactSalt string) ([]byte, error) {

Callers 1

RedactRawGlobalSyncDataFunction · 0.95

Calls 1

Sha1HashStringFunction · 0.92

Tested by

no test coverage detected