AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ComputeHashes

import "github.com/aws/aws-sdk-go/service/glacier"

func ComputeHashes(r io.ReadSeeker) Hash

ComputeHashes computes the tree-hash and linear hash of a seekable reader r.

See https://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html for more information.

r

Type: io.ReadSeeker

Hash

Hash contains information about the tree-hash and linear hash of a Glacier payload. This structure is generated by ComputeHashes().

Example

ComputeHashes

{ r := testCreateReader() h := glacier.ComputeHashes(r) n, _ := r.Seek(0, 1) fmt.Printf("linear: %x\n", h.LinearHash) fmt.Printf("tree: %x\n", h.TreeHash) fmt.Printf("pos: %d\n", n) }

On this page: