MakeAttachmentKey returns the unique for attachment storage and retrieval.
(version int, docID, digest string)
| 447 | |
| 448 | // MakeAttachmentKey returns the unique for attachment storage and retrieval. |
| 449 | func 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. |