Documentation ¶
Index ¶
- func CharsetByType(typ string) string
- func Clamp[T cmp.Ordered](val, min, max T) T
- func ExtensionByType(mimeType string) string
- func Hmac(key, data string) string
- func IsZero[T any](v T) bool
- func MD5(str string) string
- func PasswordHash(password string) (string, error)
- func PasswordVerify(password, hash string) bool
- func Sha1(str string) string
- func Sha256(str string) string
- func StripAnsi(str string) string
- func TypeByExtension(ext string) string
- type WeakMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CharsetByType ¶
func ExtensionByType ¶
func IsZero ¶
IsZero 泛型零值判断 https://stackoverflow.com/questions/74000242/in-golang-how-to-compare-interface-as-generics-type-to-nil
func PasswordHash ¶
PasswordHash 使用 Bcrypt 算法生成密码哈希值
func PasswordVerify ¶
PasswordVerify 比较输入的密码与哈希值是否匹配
func StripAnsi ¶
StripAnsi 清除 ANSI 转义代码 https://en.wikipedia.org/wiki/ANSI_escape_code https://github.com/acarl005/stripansi/blob/master/stripansi.go
func TypeByExtension ¶
Types ¶
type WeakMap ¶
type WeakMap struct {
// contains filtered or unexported fields
}
func NewWeakMap ¶
func NewWeakMap() *WeakMap
Click to show internal directories.
Click to hide internal directories.