hashing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SHA224 = "SHA224"
	SHA256 = "SHA256"
	SHA384 = "SHA384"
	SHA512 = "SHA512"
)

Variables

View Source
var ErrNotSupportedHashFunc = errors.New("not supported hash function")
View Source
var ErrTargetDataNil = errors.New("hashing target data should not be nil")

Functions

func Hash added in v0.1.1

func Hash(data []byte, opt *HashOpt) ([]byte, error)

Hash hashes the input data.

Types

type HashOpt added in v0.2.1

type HashOpt struct {
	Name     string
	HashFunc func() hash.Hash
}

func NewHashOpt added in v0.2.1

func NewHashOpt(name string) (*HashOpt, error)

Jump to

Keyboard shortcuts

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