str

package
v1.8.16 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMD5Length  = errors.New("invalid length for MD5 hash")
	ErrInvalidMD5Pattern = errors.New("value does not match MD5 hash pattern")
)

校验是否md5字符串

Functions

func FilterEmptyChar

func FilterEmptyChar(str string) string

FilterEmptyChar 过滤空字符串

func IsMd5

func IsMd5(input string) error

IsMd5 验证字符串是否是有效的 MD5 值

func Md5

func Md5(str string) string

Md5 计算字符串的md5

func PadCnSpaceChar

func PadCnSpaceChar(label string, spaces int) string

PadCnSpaceChar 使用中文空格为字符串填充

func RandomId

func RandomId() string

func RegexpMatch

func RegexpMatch(text string, pattern string) bool

func ToInt64

func ToInt64(str string) (int64, error)

ToInt64 字符串数字转换成int64

func ToPrintJSON

func ToPrintJSON(v interface{}) (string, error)

ToPrintJSON 将结构体转换为适合打印的格式化的 JSON 字符串

func ToUint32

func ToUint32(str string) uint32

ToUint32 字符串转换成uint32

func UUIDNoDash

func UUIDNoDash() string

func UniqueStrings

func UniqueStrings(input []string) []string

UniqueStrings 返回一个新的切片,其中包含原切片中的唯一字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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