utils

package
v0.0.0-...-da2935b Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64De

func Base64De(data string) ([]byte, error)

Base64De encod string

func Base64En

func Base64En(data []byte) string

Base64En encod []byte

func DayCountOfYearMonth

func DayCountOfYearMonth(year int, month int) (days int)

DayCountOfYearMonth 计算某一年某一个月的天数

func DayStart

func DayStart(t time.Time) time.Time

DayStart the start of today

func Float64Equal

func Float64Equal(a, b float64) bool

Float64Equal 比较float64是否相等

func GetConstellation

func GetConstellation(t time.Time) (star string)

func GetZodiac

func GetZodiac(t time.Time) (zodiac string)

GetZodiac zodiac

func IsDigital

func IsDigital(s string) bool

func IsToday

func IsToday(t time.Time) bool

func MD5

func MD5(data []byte) string

MD5 use md5 encrypt

func MD5Byte

func MD5Byte(data []byte) [16]byte

func MonthStart

func MonthStart(t time.Time) time.Time

MonthStart start of this month

func NDaysAfter

func NDaysAfter(t time.Time, n int) time.Time

NDaysAfter N天后

func NDaysAgo

func NDaysAgo(t time.Time, n int) time.Time

NDaysAgo N天前

func NYearsAfter

func NYearsAfter(t time.Time, n int) time.Time

NYearsAfter N年后

func NYearsAgo

func NYearsAgo(t time.Time, n int) time.Time

NYearsAgo N年前

func PrintTable

func PrintTable(writer io.Writer, headers []string, data [][]string)

func RandomDigital

func RandomDigital(bitNumber int) string

RandomDigital 生成指定位数随机数

func RandomString

func RandomString(l int) string

RandomString 生成随机字符串

func Sha256

func Sha256(data string) string

func Struct2Json

func Struct2Json(obj interface{}) string

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

func UUID

func UUID() string

func YearStart

func YearStart(t time.Time) time.Time

YearStart start of this year

func ZeroTime

func ZeroTime() time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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