checksum

package
v0.0.0-...-64a5475 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SHA512 = `sha512`
	SHA256 = `sha256`
	SHA224 = `sha224`
	SHA1   = `sha1`
	MD5    = `md5`
)

SHA512 = `sha512`

Variables

This section is empty.

Functions

func NewHash

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

NewHash returns Hash object for specified algorithm

func NormalizeAlgName

func NormalizeAlgName(alg string) (string, error)

Types

type Checksumer

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

func New

func New(wkc int, fs backend.Backend, p func(JobPusher) error) *Checksumer

func (*Checksumer) Cancel

func (ch *Checksumer) Cancel()

func (*Checksumer) Canceled

func (ch *Checksumer) Canceled() bool

func (*Checksumer) Check

func (ch *Checksumer) Check(j *Job) error

func (*Checksumer) PushError

func (ch *Checksumer) PushError() <-chan error

func (*Checksumer) Results

func (ch *Checksumer) Results() <-chan Job

type Job

type Job struct {
	Path     string
	Alg      string
	Sum      []byte
	Expected []byte
	Err      error
}

func (*Job) ExpectedString

func (j *Job) ExpectedString() string

func (*Job) SumIsExpected

func (j *Job) SumIsExpected() bool

func (*Job) SumString

func (j *Job) SumString() string

type JobPusher

type JobPusher func(Job)

Jump to

Keyboard shortcuts

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