hash

package
v0.0.0-...-51fbea3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SHA256   = "SAH256"
	SHA384   = "SAH384"
	SHA3_256 = "SHA3_256"
	SHA3_384 = "SHA3_384"
)

Variables

This section is empty.

Functions

func GetHashOpt

func GetHashOpt(hashFunc string) (csp.HashOpts, error)

GetHashOpt 目前支持的哈希函数:SHA256、SHA384、SHA3_256、SHA3_384。

Types

type Hasher

type Hasher struct {
	// contains filtered or unexported fields
}

func NewHasher

func NewHasher(hash func() hash.Hash) *Hasher

func (*Hasher) GetHash

func (h *Hasher) GetHash(opts csp.HashOpts) (hash.Hash, error)

func (*Hasher) Hash

func (h *Hasher) Hash(msg []byte, opts csp.HashOpts) ([]byte, error)

type SHA256Opts

type SHA256Opts struct{}

func (*SHA256Opts) Algorithm

func (opts *SHA256Opts) Algorithm() string

type SHA384Opts

type SHA384Opts struct{}

func (*SHA384Opts) Algorithm

func (opts *SHA384Opts) Algorithm() string

type SHA3_256Opts

type SHA3_256Opts struct{}

func (*SHA3_256Opts) Algorithm

func (opts *SHA3_256Opts) Algorithm() string

type SHA3_384Opts

type SHA3_384Opts struct{}

func (*SHA3_384Opts) Algorithm

func (opts *SHA3_384Opts) Algorithm() string

Jump to

Keyboard shortcuts

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