hashers

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHasher added in v0.1.5

func AddHasher(h Hasher)

AddHasher adds a new hash algorithm to the list.

func GetAllHasherNames added in v0.1.5

func GetAllHasherNames() []string

GetAllHasherNames returns a list of all available hash algorithms.

func GetDefaultHashAlgorithm added in v0.1.5

func GetDefaultHashAlgorithm() string

GetDefaultHashAlgorithm returns the default hash algorithm.

Types

type Hasher added in v0.1.5

type Hasher struct {
	Algorithm         common.Algorithm
	Name              string
	Extension         string
	Keyed             bool
	Compute           func(reader io.Reader, key string, fileAndRangeSpec common.FileAndRangeSpec) (string, error)
	OutputLen         int
	Validate          func(key string) error
	AcceptsFile       func(fileName string) bool
	ParseChecksumLine func(line string) (hashValue string, fileAndRangeSpec common.FileAndRangeSpec, byteCount int64, err error)
}

Hasher represents a hash function.

func GetAllHashers added in v0.1.5

func GetAllHashers() []Hasher

GetAllHashers returns a list of all available hashers.

func GetHasher added in v0.1.5

func GetHasher(name string) (Hasher, error)

GetHasher returns a Hasher for the given algorithm name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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