hmac

package
v0.0.0-...-ea7d51e Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHMACHash

func GetHMACHash(src []byte, hashType crypt.Hash, key []byte) (dst []byte, err error)

GetHMACHash gets hmac hashed bytes with defined hashType & key

func GetHMACHashEncodeToString

func GetHMACHashEncodeToString(src []byte, hashType crypt.Hash, key []byte, encodeType crypt.Encode) (dst string, err error)

GetHMACHashEncodeToString gets hmac hashed bytes with defined hashType & key then encode to string

func GetHash

func GetHash(src []byte, hashType crypt.Hash) (dst []byte, err error)

GetHash gets hashed bytes with defined hashType

func GetHashEncodeToString

func GetHashEncodeToString(src []byte, hashType crypt.Hash, encodeType crypt.Encode) (dst string, err error)

GetHashEncodeToString gets hashed bytes with defined hashType and then encode to string

Types

type HMAC

type HMAC struct {
	HashType crypt.Hash
	Key      []byte
}

func NewHMAC

func NewHMAC(hashType crypt.Hash, key []byte) *HMAC

func (*HMAC) EncodeToString

func (h *HMAC) EncodeToString(src []byte, encodeType ...crypt.Encode) (dst string, err error)

EncodeToString gets hashed bytes with defined hashType & key and then encode to string

func (*HMAC) Get

func (h *HMAC) Get(src []byte) (dst []byte, err error)

Get gets hashed bytes with defined hashType & key

Jump to

Keyboard shortcuts

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