mooonutils

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mooonutils Wrote by yijian on 2024/01/02

Package mooonutils Wrote by yijian on 2024/01/02

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountUtf8Characters

func CountUtf8Characters(utf8Str string) int

CountUtf8Characters 计算字数,一个数字、字母和汉字都分别计 1

func DesensitizeName

func DesensitizeName(name string, m, n, k int) string

DesensitizeName 脱敏姓名 name 姓名,少数民族的姓名中间可能有点号 m 保留的前 m 个字 n 保留的后 n 个字 k 单个字的字节数

func DesensitizeStr

func DesensitizeStr(str string, m, n int) string

DesensitizeStr 脱敏字符串 m 保留的前 m 个字 n 保留的后 n 个字

func GetCurrentTimestamp

func GetCurrentTimestamp(timezone string) int64

GetCurrentTimestamp 获取指定时区的当前时间戳

func GetCurrentTimestampString

func GetCurrentTimestampString(timezone string) string

func GetHexNonceStr

func GetHexNonceStr(length int) string

func GetLowercaseNonceStr

func GetLowercaseNonceStr(length int) string

func GetNonceStr

func GetNonceStr(length int) string

func GetUppercaseNonceStr

func GetUppercaseNonceStr(length int) string

func IsResidentIdentityCardNumber

func IsResidentIdentityCardNumber(id string) bool

IsResidentIdentityCardNumber 判断是否为居民身份证号

func IsValidBirthdate

func IsValidBirthdate(date string) bool

IsValidBirthdate 判断是否为有效的出生日期

func String2Time

func String2Time(dateStr string) (time.Time, error)

func TruncateUtf8String

func TruncateUtf8String(utf8Str string, maxCharCount int) string

TruncateUtf8String 截取 UTF8 字符串,使其字数(不是字节数,一个数字、字母和汉字都分别计 1)不超过 maxCharCount

Types

This section is empty.

Jump to

Keyboard shortcuts

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