util

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AsciiChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+,.?/:;{}[]`~")

Functions

func CheckPwd added in v0.1.19

func CheckPwd(reqPwd, dataPwd string) error

不同数据的加密值一定不同,相同数据的加密值一定相同,因此,在处理用户登录时只需要对用户传递的密码做加密处理,并与原加密值做比较是否一致即可

func Encrypt added in v0.1.19

func Encrypt(password string) (encryptPwd string)

MD5单向加密

func FatalOnError

func FatalOnError(err error, msg string, data ...interface{})

func LogOnError added in v0.1.18

func LogOnError(code string, err error, data ...interface{})

func NewLen added in v0.1.20

func NewLen(length int) string

func NewLenChars added in v0.1.20

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

NewLenChars returns a new random string of the provided length, consisting of the provided byte slice of allowed characters(maximum 256).

func WipeOutZero added in v0.1.20

func WipeOutZero(buf []byte) []byte

去除[]byte中的0

Types

This section is empty.

Jump to

Keyboard shortcuts

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