crypto

package
v0.0.0-...-7c4d03a Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HMacMD5

func HMacMD5(key string, src []byte) (string, error)

HMacMD5 hmac-md5加密

func HMacSha1

func HMacSha1(key string, src []byte) (string, error)

HMacSha1 hmac-sha1加密

func MD5

func MD5(src string) (string, error)

MD5 md5加密

func Sha1

func Sha1(src string) (string, error)

Sha1 sha1加密

Types

type CookieCrypto

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

CookieCrypto 用于Cookie加解密

func (*CookieCrypto) Decrypt

func (k *CookieCrypto) Decrypt(s string) (string, error)

Decrypt Cookie解密

func (*CookieCrypto) Encrypt

func (k *CookieCrypto) Encrypt(clearData string) (string, error)

Encrypt Cookie加密

func (*CookieCrypto) UpdateKeys

func (k *CookieCrypto) UpdateKeys(ekey, vkey string)

UpdateKeys 设置密钥

Jump to

Keyboard shortcuts

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