Documentation
¶
Overview ¶
Package checksum implements the S3 x-amz-checksum-* algorithms and the headers that carry them. It depends only on the standard library so it can be reused by any service that speaks the S3 checksum protocol.
Index ¶
Constants ¶
const HeaderPrefix = "x-amz-checksum-"
HeaderPrefix is the prefix an algorithm's checksum header carries ("x-amz-checksum-" + the lower-case algorithm name). It is exported because the name is built in one place and parsed in another: a chunked body's trailer names the header, and the caller verifying that trailer must build the same name this package's TrailerAlgorithm cut off it.
Variables ¶
This section is empty.
Functions ¶
func NewHash ¶
NewHash returns a hasher for the algorithm; the base64 of its Sum(nil) is the x-amz-checksum-* value. Returns nil for unsupported algorithms.
func SetHeaders ¶
SetHeaders sets x-amz-checksum-* response headers.
func TrailerAlgorithm ¶
TrailerAlgorithm returns the checksum algorithm declared in the x-amz-trailer header ("x-amz-trailer: x-amz-checksum-crc32" -> "crc32"), or "" if the request declares no checksum trailer.
Types ¶
type Values ¶
Values carries the x-amz-checksum-* values of a request or response.