digestutils

package
v0.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDigestNotMatch = errors.New("digest not match")
)

Functions

func HashFile

func HashFile(file string, hashType string) string

HashFile computes hash value corresponding to hashType, hashType is from constants.Md5Hash and constants.Sha256Hash.

func Md5Bytes

func Md5Bytes(bytes []byte) string

func Md5Reader

func Md5Reader(reader io.Reader) string

func NewDigestReader

func NewDigestReader(reader io.Reader, digest ...string) io.Reader

func Parse

func Parse(digest string) []string

func Sha256

func Sha256(values ...string) string

func ToHashString

func ToHashString(h hash.Hash) string

Types

type DigestReader

type DigestReader interface {
	io.Reader
	Digest() string
}

Jump to

Keyboard shortcuts

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