tarsum

package module
v0.0.0-...-d07f381 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2015 License: Apache-2.0 Imports: 15 Imported by: 4

README

tarsum

Docs: http://godoc.org/github.com/jlhawn/tarsum

Resumable Tarsum Digest which also implements the hash.Hash interface.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotVersion            = errors.New("string does not include a TarSum Version")
	ErrVersionNotImplemented = errors.New("TarSum Version is not yet implemented")
)

Errors that may be returned by functions in this package

Functions

This section is empty.

Types

type Digest

type Digest struct {
	// contains filtered or unexported fields
}

Digest implements a write-driven interface for calculating TarSums

func NewDigest

func NewDigest(version Version) (*Digest, error)

func (*Digest) BlockSize

func (tsd *Digest) BlockSize() int

func (*Digest) Finished

func (tsd *Digest) Finished() bool

func (*Digest) Label

func (tsd *Digest) Label() string

func (*Digest) Len

func (tsd *Digest) Len() int64

Len returns the number of bytes written to this digest.

func (*Digest) Reset

func (tsd *Digest) Reset()

func (*Digest) Restore

func (tsd *Digest) Restore(state []byte) error

func (*Digest) Size

func (tsd *Digest) Size() int

func (*Digest) State

func (tsd *Digest) State() ([]byte, error)

func (*Digest) Sum

func (tsd *Digest) Sum(extra []byte) []byte

func (*Digest) SumString

func (tsd *Digest) SumString(extra []byte) string

func (*Digest) Write

func (tsd *Digest) Write(p []byte) (n int, err error)

type Version

type Version int

versioning of the TarSum algorithm based on the prefix of the hash used i.e. "tarsum+sha256:e58fcf7418d4390dec8e8fb69d88c06ec07039d651fedd3aa72af9972e7d046b"

const (
	Version0 Version = iota
	Version1
	// NOTE: this variable will be either the latest or an unsettled next-version of the TarSum calculation
	VersionDev
)

Prefix of "tarsum"

func GetVersionFromTarsum

func GetVersionFromTarsum(tarsum string) (Version, error)

GetVersionFromTarsum returns the Version from the provided string

func GetVersions

func GetVersions() []Version

Get a list of all known tarsum Version

func (Version) String

func (tsv Version) String() string

Directories

Path Synopsis
archive
tar
Package tar implements access to tar archives.
Package tar implements access to tar archives.
Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.
Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4.

Jump to

Keyboard shortcuts

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