hasher

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

type Hasher struct {
	PartsDir    string
	PrefixParts string
	// Log			*logger.Logger
	Log logger.LoggerInterface
}

func NewHasher

func NewHasher(partsDir string, prefixParts string, log logger.LoggerInterface) *Hasher

func (*Hasher) CalculateSHA256

func (h *Hasher) CalculateSHA256(filename string) (string, error)

Function to calculate the SHA-256 hash of a file

func (*Hasher) DownloadAndParseHashFile

func (h *Hasher) DownloadAndParseHashFile(shaSumsURL string) (map[string]string, error)

func (*Hasher) HashFile

func (h *Hasher) HashFile(path string) (fileHashes, error)

func (*Hasher) HashesFromFiles

func (h *Hasher) HashesFromFiles(partsDir, prefixParts, hashType string) ([]string, error)

func (*Hasher) SetLogger

func (h *Hasher) SetLogger(log logger.LoggerInterface)

func (*Hasher) ValidateFileIntegrity

func (h *Hasher) ValidateFileIntegrity(fileName, hashType, etag string, hash string, ok bool)

Jump to

Keyboard shortcuts

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