utils

package module
v0.0.0-...-61a0c63 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(data string) []byte

func Base64Encode

func Base64Encode(bytes []byte) string

BASE64

func BytesToInt32

func BytesToInt32(bys []byte) int32

BytesToInt32 字节与int互换--大端法

func BytesToInt32Array

func BytesToInt32Array(byteData []byte) []uint32

BytesToInt32Array bytes转为int32数组

func BytesToInt64

func BytesToInt64(bys []byte) int64

BytesToInt64 字节与int互换--大端法

func BytesToUInt16

func BytesToUInt16(bys []byte) int

字节与int互换--大端法

func ConfusionArrayKey

func ConfusionArrayKey(arrayLen int) []int

乱序一个数组的key

func DoZlibCompress

func DoZlibCompress(src []byte) []byte

DoZlibCompress 进行zlib压缩

func DoZlibUnCompress

func DoZlibUnCompress(compressSrc []byte) []byte

DoZlibUnCompress 进行zlib解压缩

func GZipData

func GZipData(data []byte) string

func GZipParse

func GZipParse(baseData string) string

func GenRandomNumber

func GenRandomNumber(start int, end int, count int) []int

GenRandomNumber 生成count个start到end之间的随机数[start,end)

func GenSalt

func GenSalt() string

func GenVerifyCode

func GenVerifyCode() string

func Int32ToBytes

func Int32ToBytes(n int32) []byte

Int32ToBytes 字节与int互换--大端法

func Int64ToBytes

func Int64ToBytes(n int64) []byte

Int64ToBytes 字节与int互换--大端法

func JsonMarshal

func JsonMarshal(data interface{}) []byte

func JsonUnMarshal

func JsonUnMarshal(data []byte, v interface{}) error

func LocalIp

func LocalIp() string

获取IP地址

func Md5

func Md5(content string) string

func MilliSec

func MilliSec() int64

MilliSec 毫秒时间戳

func Rand

func Rand(min int32, max int32) int32

Rand [min, max]

func SameDay

func SameDay(stamp int64) bool

SameDay 是否同一天

func Sec

func Sec() int64

Sec 秒时间戳

func Seed

func Seed()

func TimeZero

func TimeZero() int64

TimeZero 获取当天0点时间戳

func UInt16ToBytes

func UInt16ToBytes(n int) []byte

字节与int互换--大端法

func WeekZero

func WeekZero() int64

Week 本周第一天

Types

This section is empty.

Jump to

Keyboard shortcuts

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