wutils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_FORMAT_DATE = "2006-01-02"
View Source
const DATE_FORMAT_DT = "20060102"

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(ss []byte) string

func Crc16

func Crc16(bs []byte) (crc uint16)

func DecodeInt64

func DecodeInt64(i string, key uint64) (int64, error)

func DecryptInt64

func DecryptInt64(i string, key []byte) (int64, error)

func EncodeInt64

func EncodeInt64(i int64, key uint64) string

简单加密

func EncryptInt64

func EncryptInt64(i int64, key []byte) (string, error)

key []byte 32/24/16 bytes

func FormatDate

func FormatDate(secs int64, layout string) string

func GetCurrentDT

func GetCurrentDT() int32

当前时间20060102

func GetCurrentTimeStamp

func GetCurrentTimeStamp() int64

func GetDT

func GetDT(t time.Time) int32

func GetValuesOfSlice

func GetValuesOfSlice(v interface{}, key string) (interface{}, error)

GetValuesOfSlice - 将对象数组的值塞到另一个数组里

func IntefaceSlice

func IntefaceSlice(v interface{}) []interface{}

IntefaceSlice - 通过反射

func JoinRunes

func JoinRunes(arr []rune, sep string) string

func JoinSlice

func JoinSlice(arr interface{}, sep string) (ret string, err error)

func JsonEncode

func JsonEncode(v interface{}) string

func Md5hex

func Md5hex(input string) string

func Md5s

func Md5s(input string) string

base64encode

func RandomString

func RandomString(len int) string

随机生成字符串

func RedisGzipGet

func RedisGzipGet(ctx context.Context, redisClient *redis.Client, key string) ([]byte, error)

读取并解压

func RedisGzipSet

func RedisGzipSet(ctx context.Context, redisClient *redis.Client, key string, data []byte, expired time.Duration) error

压缩存储

func Sha1s

func Sha1s(input string) string

base64encode

func Sha256s

func Sha256s(input string) string

base64encode

func SliceStringToInt

func SliceStringToInt(arr []string) []int

func SubCipher

func SubCipher(chars []rune, n int) [][]rune

func SubCipherDecode

func SubCipherDecode(cipher [][]rune, s string, min int) int

func SubCipherEncode

func SubCipherEncode(cipher [][]rune, input int, min int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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