Documentation
¶
Index ¶
- Constants
- Variables
- func Add(a, b interface{}) (string, error)
- func AddStr(input ...interface{}) string
- func AddStrLen(length int, input ...interface{}) string
- func AesCBCDecrypt(encryptedData string, key string) ([]byte, error)
- func AesCBCDecryptBase(encryptedData string, key []byte) ([]byte, error)
- func AesCBCEncrypt(plaintext []byte, key string) (string, error)
- func AesCBCEncryptBase(plaintext, key []byte) (string, error)
- func AesCBCEncryptWithIV(plaintext, key, iv []byte) (string, error)
- func AesGCMDecrypt(encryptedData string, key string) ([]byte, error)
- func AesGCMDecryptBase(encryptedData string, key, additionalData []byte) ([]byte, error)
- func AesGCMDecryptBaseByteResult(encryptedData, key, additionalData []byte) ([]byte, error)
- func AesGCMDecryptWithAAD(encryptedData string, key, additionalData string) ([]byte, error)
- func AesGCMEncrypt(plaintext []byte, key string) (string, error)
- func AesGCMEncryptBase(plaintext, key, additionalData []byte) (string, error)
- func AesGCMEncryptBaseByteResult(plaintext, key, additionalData []byte) ([]byte, error)
- func AesGCMEncryptWithAAD(plaintext []byte, key, additionalData string) (string, error)
- func AnyToStr(any interface{}) string
- func Base64Decode(input interface{}) []byte
- func Base64DecodeWithPool(input interface{}) []byte
- func Base64Encode(input interface{}) string
- func Base64EncodeWithPool(input interface{}) string
- func Bytes2Str(b []byte) string
- func CheckInt(c int, vs ...int) bool
- func CheckInt32(c int32, vs ...int32) bool
- func CheckInt64(c int64, vs ...int64) bool
- func CheckLen(o interface{}, min, max int) bool
- func CheckRangeInt(c, min, max int) bool
- func CheckRangeInt64(c, min, max int64) bool
- func CheckStr(c string, vs ...string) bool
- func CheckStrLen(str string, min, max int) bool
- func ClientIP(req *http.Request) string
- func Cmp(a, b interface{}) int
- func Div(a, b interface{}, n int32) (string, error)
- func Error(input ...interface{}) error
- func FNV1a64(s string) string
- func FNV1a64Base(b []byte) string
- func Float64ToInt64(f float64) int64
- func FmtDiv(v string, d int64) string
- func FmtEL(msg string, values ...interface{}) (string, error)
- func FmtZero(r string) string
- func GetAesIVFallback(l int) []byte
- func GetAesIVSecure() []byte
- func GetAesKeySecure(key string) []byte
- func GetAnyDayFirstAndLast(x int64) (int64, int64)
- func GetAnyMonthFirstAndLast(month int) (int64, int64)
- func GetBool(ptr uintptr) bool
- func GetBoolArr(ptr uintptr) []bool
- func GetBoolP(ptr uintptr) *bool
- func GetDayFirstAndLast() (int64, int64)
- func GetFloat32(ptr uintptr) float32
- func GetFloat32Arr(ptr uintptr) []float32
- func GetFloat32P(ptr uintptr) *float32
- func GetFloat64(ptr uintptr) float64
- func GetFloat64Arr(ptr uintptr) []float64
- func GetFloat64P(ptr uintptr) *float64
- func GetFmtDate(t int64) int64
- func GetInDayFirstAndLast(x int64) (int64, int64)
- func GetInt(ptr uintptr) int
- func GetInt8(ptr uintptr) int8
- func GetInt8Arr(ptr uintptr) []int8
- func GetInt8P(ptr uintptr) *int8
- func GetInt16(ptr uintptr) int16
- func GetInt16Arr(ptr uintptr) []int16
- func GetInt16P(ptr uintptr) *int16
- func GetInt32(ptr uintptr) int32
- func GetInt32Arr(ptr uintptr) []int32
- func GetInt32P(ptr uintptr) *int32
- func GetInt64(ptr uintptr) int64
- func GetInt64Arr(ptr uintptr) []int64
- func GetInt64P(ptr uintptr) *int64
- func GetIntArr(ptr uintptr) []int
- func GetIntP(ptr uintptr) *int
- func GetJsonBool(b []byte, k string) bool
- func GetJsonBytes(b []byte, k string) []byte
- func GetJsonFloat64(b []byte, k string) float64
- func GetJsonInt(b []byte, k string) int
- func GetJsonInt64(b []byte, k string) int64
- func GetJsonObjectBytes(b []byte, k string) []byte
- func GetJsonObjectString(b []byte, k string) string
- func GetJsonObjectValue(b []byte) *fastjson.Value
- func GetJsonString(b []byte, k string) string
- func GetLocalDynamicSecretKey() string
- func GetLocalIP() string
- func GetMonthFirstAndLast() (int64, int64)
- func GetObjectID(ptr uintptr) primitive.ObjectID
- func GetPath() string
- func GetPtr(v interface{}, offset uintptr) uintptr
- func GetRandomSecure(l int) []byte
- func GetSnowflakeNode(n int64) *snowflake.Node
- func GetString(ptr uintptr) string
- func GetStringArr(ptr uintptr) []string
- func GetStringP(ptr uintptr) *string
- func GetTime(ptr uintptr) time.Time
- func GetTimeP(ptr uintptr) *time.Time
- func GetUUID(noHyphens bool) string
- func GetUint(ptr uintptr) uint
- func GetUint8(ptr uintptr) uint8
- func GetUint8Arr(ptr uintptr) []uint8
- func GetUint8P(ptr uintptr) *uint8
- func GetUint16(ptr uintptr) uint16
- func GetUint16Arr(ptr uintptr) []uint16
- func GetUint16P(ptr uintptr) *uint16
- func GetUint32(ptr uintptr) uint32
- func GetUint32Arr(ptr uintptr) []uint32
- func GetUint32P(ptr uintptr) *uint32
- func GetUint64(ptr uintptr) uint64
- func GetUint64Arr(ptr uintptr) []uint64
- func GetUint64P(ptr uintptr) *uint64
- func GetUintArr(ptr uintptr) []uint
- func GetUintP(ptr uintptr) *uint
- func GetWeekFirstAndLast() (int64, int64)
- func HMAC_MD5(data, key string, useBase64 ...bool) string
- func HMAC_MD5_BASE(data, key []byte) []byte
- func HMAC_SHA1(data, key string, useBase64 ...bool) string
- func HMAC_SHA1_BASE(data, key []byte) []byte
- func HMAC_SHA256(data, key string, useBase64 ...bool) string
- func HMAC_SHA256_BASE(data, key []byte) []byte
- func HMAC_SHA512(data, key string, useBase64 ...bool) string
- func HMAC_SHA512_BASE(data, key []byte) []byte
- func HasStr(s1 string, s2 string) bool
- func InArray(p interface{}) []interface{}
- func Int2Time(t int64) time.Time
- func IsAccount(s string) bool
- func IsEmail(s string) bool
- func IsFloat(s string) bool
- func IsIDNO(s string) bool
- func IsIPV4(s string) bool
- func IsInt(s string) bool
- func IsMobil(s string) bool
- func IsMoney(s string) bool
- func IsMoney2(s string) bool
- func IsMoney3(s string) bool
- func IsNumber(s string) bool
- func IsNumber2(s string) bool
- func IsPKNO(s interface{}) bool
- func IsPassword(s string) bool
- func IsURL(s string) bool
- func JsonMarshal(v interface{}) ([]byte, error)
- func JsonToAny(src interface{}, target interface{}) error
- func JsonUnmarshal(data []byte, v interface{}) error
- func JsonValid(b []byte) bool
- func JsonValidString(s string) bool
- func Len(o interface{}) int
- func LinuxOS() bool
- func LoadYamlConfigFromPath(path string) (*DIC.YamlConfig, error)
- func LowerFirst(str string) string
- func MD5(s string, useBase64 ...bool) string
- func MD5_BASE(s []byte) []byte
- func MacOS() bool
- func MatchFilterURL(requestPath string, matchPattern []string) bool
- func MathAbs(n int64) int64
- func ModRand(n int) int
- func Mul(a, b interface{}) (string, error)
- func NewDeepPassword(pwd, salt string) []byte
- func NewFloat32(b []byte) (float32, error)
- func NewFloat64(b []byte) (float64, error)
- func NewInt(b []byte) (int, error)
- func NewInt8(b []byte) (int8, error)
- func NewInt16(b []byte) (int16, error)
- func NewInt32(b []byte) (int32, error)
- func NewInt64(b []byte) (int64, error)
- func NewPasswordBase(pwd, salt []byte, iter int) []byte
- func NewShortPassword(pwd, salt string) []byte
- func NewString(b []byte) (string, error)
- func NewUint(b []byte) (uint, error)
- func NewUint8(b []byte) (uint8, error)
- func NewUint16(b []byte) (uint16, error)
- func NewUint32(b []byte) (uint32, error)
- func NewUint64(b []byte) (uint64, error)
- func NextIID() int64
- func NextSID() string
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(plantText []byte, blockSize int) []byte
- func ParseJsonBase64(input interface{}, ouput interface{}) error
- func RandInt(n int) string
- func RandNonce() string
- func RandStr(n int, b ...bool) string
- func ReadFile(path string) ([]byte, error)
- func ReadJsonConfig(conf []byte, result interface{}) error
- func ReadLocalJsonConfig(path string, result interface{}) error
- func ReadLocalYamlConfig(path string, result interface{}) error
- func Reverse(s string) string
- func ReverseBase64(s string) string
- func ReverseStr(s string, x ...int) string
- func SHA1(s string, useBase64 ...bool) string
- func SHA1_BASE(s []byte) []byte
- func SHA256(s string, useBase64 ...bool) string
- func SHA256_BASE(s []byte) []byte
- func SHA512(s string, useBase64 ...bool) string
- func SHA512_BASE(s []byte) []byte
- func SetBool(ptr uintptr, v bool)
- func SetBoolArr(ptr uintptr, v []bool)
- func SetBoolP(ptr uintptr, v *bool)
- func SetDynamicSecretKey(key string)
- func SetFloat32(ptr uintptr, v float32)
- func SetFloat32Arr(ptr uintptr, v []float32)
- func SetFloat32P(ptr uintptr, v *float32)
- func SetFloat64(ptr uintptr, v float64)
- func SetFloat64Arr(ptr uintptr, v []float64)
- func SetFloat64P(ptr uintptr, v *float64)
- func SetInt(ptr uintptr, v int)
- func SetInt8(ptr uintptr, v int8)
- func SetInt8Arr(ptr uintptr, v []int8)
- func SetInt8P(ptr uintptr, v *int8)
- func SetInt16(ptr uintptr, v int16)
- func SetInt16Arr(ptr uintptr, v []int16)
- func SetInt16P(ptr uintptr, v *int16)
- func SetInt32(ptr uintptr, v int32)
- func SetInt32Arr(ptr uintptr, v []int32)
- func SetInt32P(ptr uintptr, v *int32)
- func SetInt64(ptr uintptr, v int64)
- func SetInt64Arr(ptr uintptr, v []int64)
- func SetInt64P(ptr uintptr, v *int64)
- func SetIntArr(ptr uintptr, v []int)
- func SetIntP(ptr uintptr, v *int)
- func SetObjectID(ptr uintptr, v primitive.ObjectID)
- func SetString(ptr uintptr, v string)
- func SetStringArr(ptr uintptr, v []string)
- func SetStringP(ptr uintptr, v *string)
- func SetTime(ptr uintptr, v time.Time)
- func SetTimeP(ptr uintptr, v *time.Time)
- func SetUint(ptr uintptr, v uint)
- func SetUint8(ptr uintptr, v uint8)
- func SetUint8Arr(ptr uintptr, v []uint8)
- func SetUint8P(ptr uintptr, v *uint8)
- func SetUint16(ptr uintptr, v uint16)
- func SetUint16Arr(ptr uintptr, v []uint16)
- func SetUint16P(ptr uintptr, v *uint16)
- func SetUint32(ptr uintptr, v uint32)
- func SetUint32Arr(ptr uintptr, v []uint32)
- func SetUint32P(ptr uintptr, v *uint32)
- func SetUint64(ptr uintptr, v uint64)
- func SetUint64Arr(ptr uintptr, v []uint64)
- func SetUint64P(ptr uintptr, v *uint64)
- func SetUintArr(ptr uintptr, v []uint)
- func SetUintP(ptr uintptr, v *uint)
- func Shift(input interface{}, ln int, fz bool) string
- func ShiftN(a interface{}, n int32) (string, error)
- func StartWait(msg string)
- func Str2Bytes(s string) []byte
- func Str2Date(s string) (int64, error)
- func Str2FormatTime(s string, fmt string, local *time.Location) (int64, error)
- func Str2Time(s string) (int64, error)
- func StrToBool(str string) (bool, error)
- func StrToFloat(str string) (float64, error)
- func StrToInt(str string) (int, error)
- func StrToInt8(str string) (int8, error)
- func StrToInt16(str string) (int16, error)
- func StrToInt32(str string) (int32, error)
- func StrToInt64(str string) (int64, error)
- func Sub(a, b interface{}) (string, error)
- func Substr(str string, start int, end int) string
- func Time2DateStr(t int64) string
- func Time2FormatStr(t int64, fmt string, local *time.Location) string
- func Time2Str(t int64) string
- func ToJsonBase64(input interface{}) (string, error)
- func UnixMilli() int64
- func UnixNano() int64
- func UnixSecond() int64
- func UpperFirst(str string) string
- func ValidPattern(content, pattern string) bool
- func WindowsOS() bool
- type Base64Pool
Constants ¶
const ( TimeFmt = "2006-01-02 15:04:05.000" TimeFmt2 = "2006-01-02 15:04:05.000000" DateFmt = "2006-01-02" OneDay = 86400000 OneWeek = OneDay * 7 TwoWeek = OneDay * 14 OneMonth = OneDay * 30 )
const ( MOBILE = "^1[3456789]\\d{9}$" // 手机号码 INTEGER = "^[\\-]?[1-9]+[0-9]*$|^[0]$" // 包含+-的自然数 FLOAT = "^[\\-]?[1-9]+[\\.][0-9]+$|^[\\-]?[0][\\.][0-9]+$" // 包含+-的浮点数 IPV4 = "^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$" // IPV4地址 EMAIL = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" // 邮箱地址 ACCOUNT = "^[a-zA-Z][a-zA-Z0-9_]{5,14}$" // 账号格式 PASSWORD = "^.{6,18}$" // 密码格式 URL = "http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?$" // URL格式 IDNO = "(^\\d{18}$)|(^\\d{15}$)" // 身份证格式 PKNO = "^1([3-9]{1})([0-9]{17})$" // 主键ID格式 NUMBER = "(^[1-9]([0-9]{0,29})$)|(^(0){1}$)" // 自然数 NUMBER2 = "^[0-9]+$" // 纯数字 MONEY = "(^[1-9]([0-9]{0,10})$)" // 自然数金额格式 MONEY2 = "(^[1-9]([0-9]{0,12})?(\\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\\.[0-9]([0-9])?$)" // 包含+-自然数金额格式 MONEY3 = "(^(-)?[1-9]([0-9]{0,12})?(\\.[0-9]{1,2})?$)|(^(0){1}$)|(^(-)?[0-9]\\.[0-9]([0-9])?$)" // 包含+-的浮点数金额格式 )
Variables ¶
var (
CstSH, _ = time.LoadLocation("Asia/Shanghai") //上海
)
var (
SPEL = regexp.MustCompile(`\$\{([^}]+)\}`)
)
Functions ¶
func AesCBCDecrypt ¶ added in v1.1.0
AesCBCDecrypt 字符串版本的便捷方法
func AesCBCDecryptBase ¶ added in v1.1.0
AesCBCDecryptBase 使用指定IV的AES-CBC解密
func AesCBCEncrypt ¶ added in v1.1.0
AesCBCEncrypt 字符串版本的便捷方法
func AesCBCEncryptBase ¶ added in v1.1.0
AesCBCEncryptBase 标准AES-CBC加密,返回IV+密文的Base64编码
func AesCBCEncryptWithIV ¶ added in v1.1.0
AesCBCEncryptWithIV 使用指定IV的AES-CBC加密
func AesGCMDecrypt ¶ added in v1.1.0
AesGCMDecrypt AES-GCM 解密(带认证验证)
func AesGCMDecryptBase ¶ added in v1.1.0
AesGCMDecryptBase AES-GCM 解密基础方法 会自动验证: 1. 认证标签(AuthTag)- 确保密文未被篡改 2. 附加认证数据(AAD)- 确保关联数据未被篡改 任何一项验证失败都会返回错误,拒绝解密
func AesGCMDecryptBaseByteResult ¶ added in v1.1.0
AesGCMDecryptBaseByteResult AES-GCM 解密基础方法 会自动验证: 1. 认证标签(AuthTag)- 确保密文未被篡改 2. 附加认证数据(AAD)- 确保关联数据未被篡改 任何一项验证失败都会返回错误,拒绝解密
func AesGCMDecryptWithAAD ¶ added in v1.1.0
AesGCMDecryptWithAAD AES-GCM 解密(带附加认证数据验证) additionalData: 必须与加密时使用的 AAD 完全一致
func AesGCMEncrypt ¶ added in v1.1.0
AesGCMEncrypt AES-GCM 加密(带认证)- 推荐用于金融/银行级应用 相比 CBC 的优势: 1. 内置完整性保护(GMAC 认证标签) 2. 防止密文篡改攻击 3. 无需 PKCS7 Padding(支持任意长度) 4. 并行加密(性能提升 2-5 倍) 5. TLS 1.3 强制使用 6. NIST/PCI DSS 优先推荐
func AesGCMEncryptBase ¶ added in v1.1.0
AesGCMEncryptBase AES-GCM 加密基础方法 返回格式:Base64(Nonce + Ciphertext + AuthTag) Nonce: 12 字节(GCM 标准) AuthTag: 16 字节(128-bit 认证标签)
func AesGCMEncryptBaseByteResult ¶ added in v1.1.0
AesGCMEncryptBaseByteResult AES-GCM 加密基础方法 返回格式:Byte(Nonce + Ciphertext + AuthTag) Nonce: 12 字节(GCM 标准) AuthTag: 16 字节(128-bit 认证标签)
func AesGCMEncryptWithAAD ¶ added in v1.1.0
AesGCMEncryptWithAAD AES-GCM 加密(带附加认证数据) additionalData: 不加密但需要认证的数据(如请求头、用户ID等) 使用场景:确保关联数据(如交易ID、用户ID)未被篡改
func Base64DecodeWithPool ¶ added in v1.1.0
func Base64DecodeWithPool(input interface{}) []byte
Base64DecodeWithPool 使用缓冲池进行Base64解码的便捷函数
func Base64EncodeWithPool ¶ added in v1.1.0
func Base64EncodeWithPool(input interface{}) string
Base64EncodeWithPool 使用缓冲池进行Base64编码的便捷函数
func Bytes2Str ¶
Bytes2Str 零拷贝转换 []byte 为 string
⚠️ 重要警告:返回的 string 与原始 []byte 共享内存
使用场景:
- SQL 驱动返回的 []byte(不会被修改)
- 网络协议解析的 []byte(不会被修改)
- 任何不会被修改的 []byte
性能:
- 0.10 ns/op(比 string(b) 快 200x)
- 0 B/op 零内存分配
注意:
- 不要修改原始 []byte,否则会破坏 string 的不可变性
- 此转换对任何 len/cap 组合都是正确的(总是读取 len 字段)
- 此实现依赖 Go 内部 slice/string 内存布局,未来 Go 版本可能失效
示例:
b := []byte("hello")
s := Bytes2Str(b)
fmt.Println(s) // ✅ 安全:只读访问
b[0] = 'H' // ⚠️ 危险!会修改 s 的内容
func FNV1a64Base ¶ added in v1.1.0
FNV1a64Base 快速哈希函数(非密码学安全,适合缓存键生成)
func GetAesIVFallback ¶ added in v1.1.0
GetAesIVFallback 备用IV生成方法(当crypto/rand失败时使用)
func GetAesIVSecure ¶ added in v1.1.0
func GetAesIVSecure() []byte
GetAesIVSecure 使用加密安全的随机数生成器生成IV(推荐)
func GetAesKeySecure ¶ added in v1.1.0
GetAesKeySecure 安全的AES密钥生成(推荐使用)
func GetJsonBool ¶ added in v1.0.2
func GetJsonBytes ¶ added in v1.0.102
func GetJsonFloat64 ¶ added in v1.0.102
func GetJsonInt ¶ added in v1.0.2
func GetJsonInt64 ¶ added in v1.0.104
func GetJsonObjectBytes ¶ added in v1.0.151
func GetJsonObjectString ¶ added in v1.0.151
func GetJsonObjectValue ¶ added in v1.0.151
GetJsonObjectValue 例如: v.Get("a").Get("b").MarshalTo(nil)
func GetJsonString ¶ added in v1.0.2
func GetLocalDynamicSecretKey ¶ added in v1.1.0
func GetLocalDynamicSecretKey() string
func GetObjectID ¶ added in v1.0.29
get ObjectID value
func GetRandomSecure ¶ added in v1.1.0
GetRandomSecure 使用加密安全的随机数生成器生成指定字节数组(推荐)
func GetSnowflakeNode ¶ added in v1.0.5
func HMAC_MD5_BASE ¶ added in v1.1.0
HMAC_MD5_BASE 返回原始字节数组的HMAC-MD5
func HMAC_SHA1_BASE ¶ added in v1.1.0
HMAC_SHA1_BASE 返回原始字节数组的HMAC-SHA1
func HMAC_SHA256_BASE ¶ added in v1.1.0
HMAC_SHA256_BASE 返回原始字节数组的HMAC-SHA256
func HMAC_SHA512 ¶ added in v1.0.93
func HMAC_SHA512_BASE ¶ added in v1.1.0
func IsPassword ¶
func LoadYamlConfigFromPath ¶ added in v1.1.0
func LoadYamlConfigFromPath(path string) (*DIC.YamlConfig, error)
LoadYamlConfigFromPath 从指定路径读取配置文件
func MatchFilterURL ¶
func NewDeepPassword ¶ added in v1.1.0
func NewPasswordBase ¶ added in v1.1.0
func NewShortPassword ¶ added in v1.1.0
func NewString ¶
NewString 零拷贝转换 []byte 为 string
⚠️ 重要警告:返回的 string 与原始 []byte 共享内存
使用场景:
- SQL 驱动返回的 []byte(不会被修改)
- 网络协议解析的 []byte(不会被修改)
- 任何不会被修改的 []byte
性能:
- 0.10 ns/op(比 string(b) 快 200x)
- 0 B/op 零内存分配
注意:
- 不要修改原始 []byte,否则会破坏 string 的不可变性
- 此转换对任何 len/cap 组合都是正确的(总是读取 len 字段)
- 此实现依赖 Go 内部 slice/string 内存布局,未来 Go 版本可能失效
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func ParseJsonBase64 ¶
func ParseJsonBase64(input interface{}, ouput interface{}) error
func ReadLocalJsonConfig ¶
读取本地JSON配置文件
func ReadLocalYamlConfig ¶ added in v1.1.0
读取本地YAML配置文件
func ReverseBase64 ¶
func ReverseStr ¶
func SetDynamicSecretKey ¶ added in v1.1.3
func SetDynamicSecretKey(key string)
func SetObjectID ¶ added in v1.0.29
set ObjectID value
func Str2Bytes ¶
Str2Bytes 零拷贝转换 string 为 []byte
⚠️ 重要警告:返回的 []byte 与原始 string 共享内存
使用场景:
- 只读访问(哈希计算、HMAC、加密等)
- 临时传参(不会被修改的场景)
- 性能关键路径(高频调用)
性能:
- 0.10 ns/op(比 []byte(s) 快 200x)
- 0 B/op 零内存分配
注意:
- string 在 Go 中是不可变的(immutable),底层数据存储在只读内存段
- 尝试修改返回的 []byte 会触发运行时 panic(写入只读内存)
- 返回的 []byte 保证 len == cap
- 此实现依赖 Go 内部 string/slice 内存布局,未来版本可能失效
示例:
s := "hello" b := Str2Bytes(s) hash := md5.Sum(b) // ✅ 安全:只读访问 b[0] = 'H' // ⚠️ 运行时 panic:尝试写入只读内存
func Str2FormatTime ¶ added in v1.0.161
格式字符串转时间戳/毫秒
func Time2FormatStr ¶ added in v1.0.160
时间戳转格式字符串/毫秒
func ToJsonBase64 ¶
func ValidPattern ¶
Types ¶
type Base64Pool ¶ added in v1.1.0
type Base64Pool struct {
// contains filtered or unexported fields
}
Base64Pool Base64编解码缓冲池
func (*Base64Pool) Decode ¶ added in v1.1.0
func (p *Base64Pool) Decode(input interface{}) []byte
Decode 使用缓冲池进行Base64解码
func (*Base64Pool) Encode ¶ added in v1.1.0
func (p *Base64Pool) Encode(input interface{}) string
Encode 使用缓冲池进行Base64编码
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package decimal implements an arbitrary precision fixed-point decimal.
|
Package decimal implements an arbitrary precision fixed-point decimal. |
|
Package snowflake provides a very simple Twitter snowflake generator and parser.
|
Package snowflake provides a very simple Twitter snowflake generator and parser. |