checksum

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package checksum implements the flexible-checksum algorithms S3 accepts: CRC32, CRC32C, SHA1, SHA256 from the standard library, and CRC64NVME in-house (Go has no stdlib implementation; it is a ~30-line table-driven CRC with the NVMe polynomial). Values travel base64-encoded on the wire.

Composite reproduces the multipart "checksum-of-checksums" form the SDKs validate: the algorithm applied over the concatenated per-part digests, suffixed with "-<parts>".

Index

Constants

This section is empty.

Variables

View Source
var Algorithms = []string{"CRC32", "CRC32C", "CRC64NVME", "SHA1", "SHA256"}

Algorithms lists the supported x-amz-checksum-* suffixes in canonical form.

Functions

func Composite

func Composite(alg string, partSums [][]byte) (string, error)

Composite computes the multipart composite checksum: alg over the concatenated raw per-part digests, base64, suffixed with the part count.

func Encode

func Encode(sum []byte) string

Encode renders a digest the way it travels on the wire.

func New

func New(alg string) (hash.Hash, error)

New returns a fresh hash for a canonical algorithm name.

func Supported

func Supported(alg string) (string, bool)

Supported reports whether alg (any case) is a supported algorithm, and returns its canonical spelling.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL