utils

package
Version: v0.0.0-...-8d4382c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

**************************************************

** @Desc : This file for ...
** @Time : 2018-8-30 13:50
** @Author : Joker
** @File : ACE_ECB
** @Last Modified by : Joker
** @Last Modified time: 2018-8-30 13:50
** @Software: GoLand

***************************************************

**************************************************

** @Desc : This file for ...
** @Time : 2019/8/21 10:21
** @Author : yuebin
** @File : date_time
** @Last Modified by : yuebin
** @Last Modified time: 2019/8/21 10:21
** @Software: GoLand

***************************************************

**************************************************

** @Desc : generate login verify code image
** @Time : 2019/8/7 17:14
** @Author : yuebin
** @File : login_verify_code
** @Last Modified by : yuebin
** @Last Modified time: 2019/8/7 17:14
** @Software: GoLand

***************************************************

**************************************************

** @Desc : 获取一个md5的字符串
** @Time : 2019/8/9 16:06
** @Author : yuebin
** @File : md5
** @Last Modified by : yuebin
** @Last Modified time: 2019/8/9 16:06
** @Software: GoLand

***************************************************

**************************************************

** @Desc : This file for ...
** @Time : 2019/10/26 11:08
** @Author : yuebin
** @File : sign_verify
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/26 11:08
** @Software: GoLand

***************************************************

**************************************************

** @Desc : This file for ...
** @Time : 2019/10/26 11:17
** @Author : yuebin
** @File : sort_go
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/26 11:17
** @Software: GoLand

***************************************************

Index

Constants

View Source
const (
	// Standard length of uniuri string to achive ~95 bits of entropy.
	StdLen = 16
	// Length of uniurl string to achive ~119 bits of entropy, closest
	// to what can be losslessly converted to UUIDv4 (122 bits).
	UUIDLen = 20
)

Variables

View Source
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")

Functions

func AesDecrypt

func AesDecrypt(src, key []byte) []byte

aes解码 crypted:要加密的字符串 key:用来加密的密钥 密钥长度可以是128bit、192bit、256bit中的任意一个 16位key对应128bit

func AesEncrypt

func AesEncrypt(src []byte, key string) []byte

aes编码

func GetBasicDateTime

func GetBasicDateTime() string

func GetDate

func GetDate() string

func GetDateBeforeDays

func GetDateBeforeDays(days int) string

func GetDateTimeBeforeDays

func GetDateTimeBeforeDays(days int) string

func GetDateTimeBeforeHours

func GetDateTimeBeforeHours(hour int) string

func GetDateTimeNot

func GetDateTimeNot() string

func GetMD5LOWER

func GetMD5LOWER(s string) string

* 获取小写的MD5

func GetMD5Sign

func GetMD5Sign(params map[string]string, keys []string, paySecret string) string

func GetMD5Upper

func GetMD5Upper(s string) string

* 获取大写的MD5

func GetNowTimesTamp

func GetNowTimesTamp() string

func Md5Verify

func Md5Verify(params map[string]string, paySecret string) bool

* 验签

func New

func New() string

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.

func NewLen

func NewLen(length int) string

func NewLenChars

func NewLenChars(length int, chars []byte) string

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func SortMap

func SortMap(m map[string]string) []string

* 对map的key值进行排序

Types

type Image

type Image struct {
	*image.NRGBA
	// contains filtered or unexported fields
}

func GenerateVerifyCodeImg

func GenerateVerifyCodeImg() (*Image, string)

func NewImage

func NewImage(digits []byte, width, height int) *Image

func (*Image) WriteTo

func (img *Image) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL