hash

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Valid hashes
	MD5      = "md5"
	SHA1     = "sha1"
	SHA256   = "sha256"
	SHA512   = "sha512"
	SHA3_256 = "sha3-256"
	SHA3_512 = "sha3-512"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

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

Hasher is a type for optimizing file hashing

func NewHasher

func NewHasher(hashAlgorithm string, bufSize int) *Hasher

NewHasher returns a new hasher with the hash algorithm and buffer size specified. It panics if the hash algorithm is invalid.

func (*Hasher) HashFile

func (h *Hasher) HashFile(f *common.File) error

HashFile will take a file, hash it, and update its hash. It requires that the AbsPath of the file provided is not empty.

Jump to

Keyboard shortcuts

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