utils

package
v0.0.0-...-fdfd418 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Big5ToUTF8

func Big5ToUTF8(s string) ([]byte, error)

convert BIG5 to UTF-8

func EscapeJson

func EscapeJson(s string) string

转义json特殊字符

func GBKToUTF8

func GBKToUTF8(s string) ([]byte, error)

convert GBK to UTF-8

func InStringSlice

func InStringSlice(slice []string, element string) bool

func Md5

func Md5(str string) string

生成32位MD5摘要

func PanicToError

func PanicToError(f func()) (err error)

PanicToError Panic转换为error

func PanicTrace

func PanicTrace(err interface{}) string

PanicTrace panic调用链跟踪

func RandAuthToken

func RandAuthToken() string

func RandNumber

func RandNumber(max int) int

生成0-max之间随机数

func RandomString

func RandomString(n int64) string

生成长度为length的随机字符串

func ReplaceStrings

func ReplaceStrings(s string, old []string, replace []string) string

批量替换字符串

func UTF8ToBig5

func UTF8ToBig5(s string) ([]byte, error)

convert UTF-8 to BIG5

func UTF8ToGBK

func UTF8ToGBK(s string) ([]byte, error)

convert UTF-8 to GBK

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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