hashsum

package
v0.0.0-...-923e5ac Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR_HASH_FUNCTION       = 20 // the hash function has returned an error and hopefully it'll be descriptive in stderr
	ERROR_INVALID_FILE_FORMAT = 21 // the compare file format was detected as invalid (eg wrong hashfunction)
)

Variables

This section is empty.

Functions

func Adler32

func Adler32(input *Input) (exitCode uint8)

hash a file or stdin

func Compare

func Compare(input *Input) (exitCode uint8)

func Crc32

func Crc32(input *Input) (exitCode uint8)

hash a file or stdin

func Crc64

func Crc64(input *Input) (exitCode uint8)

hash a file or stdin

func Hash

func Hash(input *Input, output abstract.OutputInterface, helper *iotool.FileHelper, factory func() hash.Hash, paths <-chan string) (exitCode uint8)

func HashFromList

func HashFromList(input *Input, output abstract.OutputInterface, helper *iotool.FileHelper, factory func() hash.Hash, paths ...string) (exitCode uint8)

func Hashsum

func Hashsum(input *Input) (exitCode uint8)

hash a file or stdin

func Md5

func Md5(input *Input) (exitCode uint8)

hash a file or stdin

func Sha1

func Sha1(input *Input) (exitCode uint8)

hash a file or stdin

func Sha224

func Sha224(input *Input) (exitCode uint8)

hash a file or stdin

func Sha256

func Sha256(input *Input) (exitCode uint8)

hash a file or stdin

func Sha384

func Sha384(input *Input) (exitCode uint8)

hash a file or stdin

func Sha512

func Sha512(input *Input) (exitCode uint8)

hash a file or stdin

func Sha512_224

func Sha512_224(input *Input) (exitCode uint8)

hash a file or stdin

func Sha512_256

func Sha512_256(input *Input) (exitCode uint8)

hash a file or stdin

Types

type HashPath

type HashPath struct {
	Hash, Path []byte
}

type Input

type Input struct {
	abstract.Input

	PathList []string
	Type     Type

	Salt []byte

	Compare            bool
	OrderCompareOutput bool
	Quiet              bool
	NoCache            bool
	NumberOfWorkers    uint
	Idiot              uint
}

type Type

type Type uint8
const (
	NONE       Type = 0
	SHA1       Type = 1
	SHA224     Type = 2
	SHA256     Type = 3
	SHA384     Type = 4
	SHA512_224 Type = 5
	SHA512_256 Type = 6
	SHA512     Type = 7
	MD5        Type = 8
	ADLER32    Type = 9
	CRC32      Type = 10
	CRC64      Type = 11
)

func ParseType

func ParseType(input string) Type

parse me!

func (Type) Factory

func (t Type) Factory(input *Input) func() hash.Hash

return corresponding hash factory

func (Type) Len

func (t Type) Len() uint

return the length of the hex encoded hash in byte

func (Type) String

func (t Type) String() string

string me!

func (Type) Valid

func (t Type) Valid() bool

is valid

type TypeInterface

type TypeInterface interface {
	Valid() bool
	String() string
	Len() uint
	Factory() func() hash.Hash
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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