aksk

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAppKey

func GenAppKey() string

GenAppKey 生成appkey

func GenAppSecret

func GenAppSecret() string

GenAppSecret 生成默认64位AppSecret

func GenAppSecretBy

func GenAppSecretBy(appKey string) string

GenAppSecretBy 根据指定内容生成AppSecret

func SHA1 added in v0.3.2

func SHA1(appId, appSecret, nonce string, timestamp int64) string

SHA1 sha1签名

func Signature

func Signature(content, secret string, hash crypto.Hash) (string, error)

Signature 生成签名

func Verify

func Verify(content, sign, secret string, hash crypto.Hash) error

Verify 验签

Types

type AKSK

type AKSK uint
const (
	SHA256 AKSK = 1 + iota
	SHA3_256
	SHA3_512
	MD5
)

func (AKSK) Hash

func (aksk AKSK) Hash() crypto.Hash

func (AKSK) Signature

func (aksk AKSK) Signature(appId, appSecret, nonce string, timestamp int64) (string, error)

Signature 生成签名

Jump to

Keyboard shortcuts

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