hashutils

package
v0.0.0-...-91b4725 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeFileHash

func ComputeFileHash(filePath string, hashAlg hash.Hash) (string, error)

This is a separate function from ComputeHash because streaming the file contents into the hasher is more efficient than reading the entire file into memory at once, especially for larger files.

func ComputeHash

func ComputeHash(contents string, hashAlg hash.Hash) string

func GetHashAlgorithm

func GetHashAlgorithm(hashOpt HashType) (hash.Hash, error)

Types

type HashType

type HashType int
const (
	HashTypeNone   HashType = 0
	HashTypeSHA1   HashType = 1
	HashTypeSHA256 HashType = 2
)

Jump to

Keyboard shortcuts

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