Documentation ¶
Index ¶
- func Base62ToSHA256(base62Str string) (string, error)
- func CalcHash(input string, useStream bool, hashFunc hash.Hash) (string, error)
- func FilterEmptyChar(str string) string
- func GenFixedStrWithSeed(input, seed string) string
- func GenSha1(input string) string
- func GetDirNameFromSnowflakeID(snowflakeID int64) string
- func IsAlphaNum(str string) bool
- func Md5(input string, useStream bool) (string, error)
- func PadCnSpaceChar(label string, spaces int) string
- func RegexpMatch(txt string, pattern string) (bool, error)
- func SHA256ToBase62(sha256Hash string) (string, error)
- func Sha256(input string, useStream bool, isSha3 bool) (string, error)
- func ToInt64(intStr string) (int64, error)
- func ToPrettyJson(v interface{}, isProto bool) (string, error)
- func ToUint32(str string) uint32
- func UnicodeLength(str string) int
- func UniqueStrings(input []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base62ToSHA256 ¶ added in v1.8.94
Base62ToSHA256 将Base62编码转回SHA256(用于验证)
func CalcHash ¶ added in v1.8.68
CalcHash 计算字符串或文件的哈希(支持 MD5、SHA256 和 SHA3-256) - input: 要计算哈希的字符串或文件路径 - useStream: 是否使用流的方式计算哈希 - hashFunc: 哈希函数 (hash.Hash)
func GenFixedStrWithSeed ¶ added in v1.8.68
GenFixedStrWithSeed 根据给定的字符串和种子生成一个可反复重现的哈希字符串(不适合密码用)
func GetDirNameFromSnowflakeID ¶ added in v1.8.68
GetDirNameFromSnowflakeID 根据 Snowflake ID 生成目录名
func PadCnSpaceChar ¶
PadCnSpaceChar 使用中文空格为字符串填充
func RegexpMatch ¶
RegexpMatch 使用正则表达式匹配字符串
func SHA256ToBase62 ¶ added in v1.8.94
SHA256ToBase62 将SHA256转换为Base62编码
func ToPrettyJson ¶ added in v1.8.68
ToPrettyJson 将数据结构转换为格式化的 JSON 字符串
func UnicodeLength ¶ added in v1.8.68
UnicodeLength 计算unicode字符串的字符长度
func UniqueStrings ¶
UniqueStrings 返回一个新的切片,其中包含原切片中的唯一字符串
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.