hashing

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

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 HashesForResource

func HashesForResource(r io.Reader, hashAlgorithms []HashAlgorithm) ([]*Hash, error)

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