util

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 13 Imported by: 7

Documentation

Index

Constants

View Source
const (
	DefaultTimeFormatter = "2006-01-02 15:04:05"
	DateFormatter        = "20060102"
	DatePlusFormatter    = "2006-01-02"
	TimeFormatter        = "150405"
	TimePlusFormatter    = "15:04:05"
)

Variables

This section is empty.

Functions

func BytesToHex

func BytesToHex(data []byte, padding ...string) string

BytesToHex 字节转换Hex字符串 padding[0]: 左填充 padding[1]:右填充(最后一个字节不填充)

func FormatTime

func FormatTime(t time.Time) (s string)

func Int64ToBytes

func Int64ToBytes(n int64) (bs []byte)

Int64ToBytes int64-->8byte

func Join

func Join(delimiter string, s ...string) string

func NewInterval

func NewInterval(ctx context.Context, duration time.Duration, exitOnErr bool, task func() error)

func PKCS5Padding

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

PKCS5Padding 末尾填充字节

func PKCS5UnPadding

func PKCS5UnPadding(data []byte) []byte

func RandHexStr

func RandHexStr(n int) (s string)

RandHexStr 随机字符串,hex表示.

n:字节数,返回2n个hex字符

func RandStr

func RandStr(n int) (s string)

RandStr 随机字符串,返回n个字符

func UUIDString

func UUIDString() (s string)

func Walk

func Walk(root string, depth int, fun func(path string, info os.FileInfo)) (err error)

func ZerosPadding

func ZerosPadding(data []byte, blockSize int) []byte

ZerosPadding 末尾填充0

func ZerosUnPadding

func ZerosUnPadding(data []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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