crypto

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(text string, key string) (string, error)

AesDecrypt ...

func AesEncrypt

func AesEncrypt(text string, key string) (string, error)

AesEncrypt ...

func Base64Decode

func Base64Decode(text string) string

Base64Decode ...

func Base64Encode

func Base64Encode(text string) string

Base64Encode ...

func JsonEncode

func JsonEncode(elem interface{}) string

JsonEncode ...

func NewSnowflake

func NewSnowflake(workerid int64) (*snowflake, error)

NewSnowflake ...

func UrlDecode

func UrlDecode(text string) string

UrlDecode ...

func UrlEncode

func UrlEncode(text string) string

UrlEncode ...

Types

type JWT

type JWT struct {
	Key    string
	Expire int
}

JWT ...

func NewJWT

func NewJWT(key string, expire int) *JWT

NewJWT ...

func (*JWT) GetToken

func (t *JWT) GetToken(payload map[string]interface{}) (string, error)

GetToken ...

func (*JWT) ParseToken

func (t *JWT) ParseToken(tokenString string) (map[string]interface{}, error)

ParseToken ...

Jump to

Keyboard shortcuts

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