hashing

package
v1.20.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 12 Imported by: 427

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash struct {
	Algorithm HashAlgorithm
	HashValue []byte
}

func FromString

func FromString(s string) (*Hash, error)

func MustFromString added in v1.20.0

func MustFromString(s string) *Hash

func (*Hash) Equal

func (l *Hash) Equal(r *Hash) bool

func (*Hash) Hex

func (h *Hash) Hex() string

func (*Hash) String

func (h *Hash) String() string

type HashAlgorithm

type HashAlgorithm string
const (
	HashAlgorithmSHA256 HashAlgorithm = "sha256"
	HashAlgorithmSHA1   HashAlgorithm = "sha1"
	HashAlgorithmMD5    HashAlgorithm = "md5"
)

func (HashAlgorithm) FromString

func (ha HashAlgorithm) FromString(s string) (*Hash, error)

func (HashAlgorithm) Hash

func (ha HashAlgorithm) Hash(r io.Reader) (*Hash, error)

func (HashAlgorithm) HashFile

func (ha HashAlgorithm) HashFile(p string) (*Hash, error)

func (HashAlgorithm) NewHasher

func (ha HashAlgorithm) NewHasher() hash.Hash

Jump to

Keyboard shortcuts

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