Versions in this module Expand all Collapse all v0 v0.1.0 Jul 27, 2015 Changes in this version + const DigestSha256EmptyTar + const DigestTarSumV1EmptyTar + var DigestRegexp = regexp.MustCompile(`[a-zA-Z0-9-_+.]+:[a-fA-F0-9]+`) + var DigestRegexpAnchored = regexp.MustCompile(`^` + DigestRegexp.String() + `$`) + var ErrDigestAmbiguous = errors.New("ambiguous digest string") + var ErrDigestInvalidFormat = fmt.Errorf("invalid checksum digest format") + var ErrDigestNotFound = errors.New("digest not found") + var ErrDigestUnsupported = fmt.Errorf("unsupported digest algorithm") + var TarsumRegexp = regexp.MustCompile("tarsum(?:.[a-z0-9]+)?\\+[a-zA-Z0-9]+:[A-Fa-f0-9]+") + var TarsumRegexpCapturing = regexp.MustCompile("(tarsum)(.([a-z0-9]+))?\\+([a-zA-Z0-9]+):([A-Fa-f0-9]+)") + func ShortCodeTable(dst *Set, length int) map[Digest]string + type Algorithm string + const Canonical + const SHA256 + const SHA384 + const SHA512 + const TarsumV1SHA256 + func (a Algorithm) Available() bool + func (a Algorithm) Hash() hash.Hash + func (a Algorithm) New() Digester + type Digest string + func FromBytes(p []byte) (Digest, error) + func FromReader(rd io.Reader) (Digest, error) + func FromTarArchive(rd io.Reader) (Digest, error) + func NewDigest(alg Algorithm, h hash.Hash) Digest + func NewDigestFromHex(alg, hex string) Digest + func ParseDigest(s string) (Digest, error) + func (d Digest) Algorithm() Algorithm + func (d Digest) Hex() string + func (d Digest) String() string + func (d Digest) Validate() error + type Digester interface + Digest func() Digest + Hash func() hash.Hash + type InvalidTarSumError string + func (e InvalidTarSumError) Error() string + type Set struct + func NewSet() *Set + func (dst *Set) Add(d Digest) error + func (dst *Set) Lookup(d string) (Digest, error) + type TarSumInfo struct + Algorithm string + Digest string + Version string + func ParseTarSum(tarSum string) (tsi TarSumInfo, err error) + func (tsi TarSumInfo) String() string + type Verifier interface + Verified func() bool + func NewDigestVerifier(d Digest) (Verifier, error) + func NewLengthVerifier(expected int64) Verifier