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

Function MakeAttachmentKey

db/attachment.go:449–454  ·  view source on GitHub ↗

MakeAttachmentKey returns the unique for attachment storage and retrieval.

(version int, docID, digest string)

Source from the content-addressed store, hash-verified

447
448// MakeAttachmentKey returns the unique for attachment storage and retrieval.
449func MakeAttachmentKey(version int, docID, digest string) string {
450 if version == AttVersion2 {
451 return base.Att2Prefix + sha256Digest([]byte(docID)) + ":" + digest
452 }
453 return base.AttPrefix + digest
454}
455
456// sha256Digest returns sha256 digest of the input bytes encoded
457// by using the standard base64 encoding, as defined in RFC 4648.

Calls 1

sha256DigestFunction · 0.85