Documentation
¶
Overview ¶
provides common digest calculation utilities
Index ¶
- func CalculateDirectory(dirPath string, extensions []string) (string, error)
- func CalculateFile(filepath string) (string, error)
- func CalculateReader(r io.Reader) (string, error)
- func CleanupTempDir(dirPath string) error
- func CreateTempDir(prefix string) (string, func(), error)
- func Format(algorithm, hexDigest string) string
- func Normalize(digest string) string
- func Parse(digest string) (algorithm, hexDigest string, err error)
- func ValidateFormat(algorithm, hexDigest string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateDirectory ¶
calculates a combined hash of all files in a directory
func CalculateFile ¶
calculates the SHA256 digest of a file
func CalculateReader ¶
calculates the SHA256 digest from a reader
func CleanupTempDir ¶
removes temp dir if it's under os.TempDir()
func CreateTempDir ¶
creates a temp dir and returns its path along with cleanup func
func ValidateFormat ¶
validates digest format based on algorithm
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.