util

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DateLayout = "2006-01-02"
View Source
const SimpleDateLayout = "20060102"
View Source
const SimpleMinteLayout = "1504"

Variables

This section is empty.

Functions

func Copy

func Copy(toValue interface{}, fromValue interface{}) error

func FormatDate

func FormatDate(t *time.Time) string

func FormatDateSimple

func FormatDateSimple(t *time.Time) string

func FormatMinuteSimple added in v0.13.0

func FormatMinuteSimple(t *time.Time) string

func HmacMD5

func HmacMD5(secret []byte, plain []byte) ([]byte, error)

HmacMD5 return HMAC-MD5 hash

func HmacSHA1

func HmacSHA1(secret []byte, plain []byte) ([]byte, error)

HmacSHA1 return HMAC-SHA1 hash

func HmacSHA256

func HmacSHA256(secret []byte, plain []byte) ([]byte, error)

HmacSHA256 return HMAC-SHA256 hash

func ParseDateSimple

func ParseDateSimple(v string) (time.Time, error)

func ParseDecimal

func ParseDecimal(value string) (res *decimal.Decimal, err error)

func Percent

func Percent(d *decimal.Decimal) *decimal.Decimal

func SHA1

func SHA1(data []byte) []byte

SHA1 compute sha1 hash

func UnsafeBytesToString

func UnsafeBytesToString(b []byte) string

UnsafeBytesToString convert bytes to string without memory allocation

func UnsafeStringToBytes

func UnsafeStringToBytes(s string) []byte

UnsafeStringToBytes convert string to bytes without memory allocation

Types

This section is empty.

Jump to

Keyboard shortcuts

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